1. 实现DevExpress GridControl 只有鼠标双击后才进行修改数据:修改GridView.OptionsBehavior.EditorShowMode属性为Click
2. 实现DevExpress GridControl 只有鼠标双击后才进行修改数据:修改GridView.OptionsBehavior.EditorShowMode属性为MouseDownFocused
然后实现下面代码:
private void gridView1_MouseDown(object sender, MouseEventArgs e) { GridView view = sender as GridView; GridHitInfo hitInfo = view.CalcHitInfo(e.Location); if (hitInfo.InRowCell && e.Button == System.Windows.Forms.MouseButtons.Left) { if (e.Clicks == 1) { view.FocusedColumn = hitInfo.Column; view.FocusedRowHandle = hitInfo.RowHandle; } else if (e.Clicks == 2) view.ShowEditor(); DXMouseEventArgs.GetMouseArgs(e).Handled = true; } }