0

I am using a Datagrid and was asked to remove the annoying "double click" behavior of the Standard DataGrid, which contains a large number of autogenerated Checkbox-Columns.

I found this Style, which works well enough:

<Trigger Property="IsMouseOver" Value="True">
     <Setter Property="IsEditing" Value="True" />
</Trigger>

If used, only a single click is needed to edit the Checkbox.

Unfortunately, when this Style is used, the Checkboxes of the DataGrid are visually working, but the changes are not reflected in the DataTable. This is probably due to the fact, that the cells are still in Editing Mode. How can I circumvent this problem?

I tried to simple force cells to finish editing when the mouse leaves, but that does not work:

<Trigger Property="IsMouseOver" Value="False">
    <Setter Property="IsEditing" Value="False" />
</Trigger>
4

1 回答 1

1

我认为您必须定义自己的单元格模板,其中包含一个复选框。

来源:http ://social.msdn.microsoft.com/Forums/vstudio/en-US/e1858654-26bd-4050-a1be-1f5d0209b1fe/how-do-i-change-a-datagrid-checkbox-without-clicking-两次

于 2013-08-09T13:27:27.367 回答