Category / Section
How to control the mouse button that affects the selection of cells in WinForms GridControl?
1 min read
Selection
By default, left and right mouse buttons affect the selection of cells in the GridControl. You can control the mouse buttons by using the SelectCellsMouseButtonsMask property.
Solution:
You can set the SelectCellsMouseButtonsMask property in order to control the behavior of the mouse buttons when selecting cells.
C#
//Controls selection on Mouse button on Form load. this.gridControl1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;
VB
'Controls selection on Mouse button on Form load. Me.gridControl1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left
This prevents the right button from affecting any of the selection.
Figure 1: Selection in the GridControl
Samples:
C#: MouseButton-C#
VB: MouseButton-VB