This example shows how to handle the MouseDown
event in Grid View so that users can change the state of a checkbox with a single click. In this example, the OptionsSelection.MultiSelectMode property is set to GridMultiSelectMode.CellSelect
.
private void gridView1_MouseDown(object sender, MouseEventArgs e) {
GridHitInfo hitInfo = gridView1.CalcHitInfo(e.Location);
if (hitInfo.InRowCell) {
if (hitInfo.Column.RealColumnEdit is RepositoryItemCheckEdit) {
gridView1.FocusedColumn = hitInfo.Column;
gridView1.FocusedRowHandle = hitInfo.RowHandle;
gridView1.ShowEditor();
CheckEdit edit = gridView1.ActiveEditor as CheckEdit;
if (edit == null) return;
edit.Toggle();
DXMouseEventArgs.GetMouseArgs(e).Handled = true;
}
}
}
(you will be redirected to DevExpress.com to submit your response)