When the user clicks on a row in the datagrid (or uses the keyboard), that row is selected, but the specific cell they clicked on is also given its own special focus. This is fine for a data editing grid, but I am trying to create something more like an open dialog that shows properties for each item in the list, so...
Is it possible to configure a (readonly) DataGrid so that the user can only select or focus on entire rows, not individual fields.
If that is not possible, is there a elegant way of making only the first element selectable - for example in the standard Windows Open dialog, if you change to Details view there are several columns for each row (Filename, Created Date, Size, etc), but you can only highlight items in the filename column.
You could create an style in like these samples to highlight and align I have:
later you put:
....
I hope this works for anyone who's wandering how to highlight a full row in WPF DataGrid.
you can change the style of the DataGridCell Here is a post that will help http://leeontech.wordpress.com/2009/06/29/hilighting-entire-rows-in-datagrid/
Here is my (lame) version that adds a black background on the selected row and grey background on the current row. I had to overwrite the styles because I was painting the cells individually and the row selected was hidden.
Just add the pasted code to you DataGrid instance: