10
votes

WPF's DataGrid requires a double click to enter cell editing mode, and then the user can change the checkbox value.

How to make a cell editable without requiring the double click for entering the edit mode?

1
possible duplicate of wpf datagrid enter to editJader Dias

1 Answers

12
votes

Just think of using a CheckBox directly in your CellTemplate.

<DataGridTemplateColumn Header="Your boolean column">
  <DataGridTemplateColumn.CellTemplate>
      <DataTemplate>
          <CheckBox IsChecked="{Binding YourBooleanProperty, UpdateSourceTrigger=PropertyChanged}" />
      </DataTemplate>
  </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>