Articles in this section
Category / Section

How to control the mouse button that affects the selection of cells in WinForms GridControl?

1 min read



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.


You can set the SelectCellsMouseButtonsMask property in order to control the behavior of the mouse buttons when selecting cells.


//Controls selection on Mouse button on Form load.
this.gridControl1.Model.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;


'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.

Selection in the GridControl

Figure 1: Selection in the GridControl


C#: MouseButton-C#

VB: MouseButton-VB

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment