Thursday, May 5, 2011

Double click issue with DataGridCheckbox column

DataGridCheckboxColumn in DataGrid seems to have double click issue. One has to click twice to check or uncheck, first click to select the row and the second click for the checkbox. We can use DataGridTemplateColumn instead for the checkbox which does not have double click issue. 

sample code:

<DataGridTemplateColumn Header="Name">
<controlsData:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox Content="{Binding Name}" IsChecked="{Binding Path=IsSelected,Mode=TwoWay}" />
</DataTemplate>
</controlsData:DataGridTemplateColumn.CellTemplat>
</DataGridTemplateColumn>

No comments:

Post a Comment