DataGrid - can I make its rows 'unselectable'?

Mar 25, 2009 at 6:00 PM
I have a DataGrid which I have bound to a DataTable containing boolean values which it has rendered as checkboxes, exactly as I want. However, my problem is that when I click on one of the checkboxes, the first click simply selects the row that the checkbox is on, then it takes another click to check/uncheck the checkbox.
I can override the style of the DataGridCell in xaml to prevent it showing the blue background when a row is selected, but this doesn't get over the problem of it taking two clicks to check or uncheck a checkbox, because the first one is selecting the row.
Is there any way of making it so that the rows are 'unselectable', that is, ideally so that the DataGrid has no concept of a 'selected' row, and that clicking on any checkbox will check/uncheck it?

Mar 26, 2009 at 9:44 PM
Use this (single click editing) along with setting the highlight color to transparent. It is as good as disabling selection for an end user.
Mar 27, 2009 at 10:39 AM
That works great, thanks very much