I’m using WPF and .NET 4.0. Recently in one of my programs I switched from using ListView with GridView to DataGrid.
I want to be able to select and highlight the whole row like I was able to do in ListView.
In ListView, when I click on the empty space right from the last column, I’m still able to select the row. The whole row is highlighted, not only the cells.
In DataGrid however, after setting SelectionMode=”Single” and SelectionUnit=”FullRow”, the row is selectable only when I click on any cell in it, not in the empty space right to the last column.
How can I use the highlighting behavior from ListView here?
There are two solutions:
I personally prefer the first solution; it’s cleaner than the second one.