Articles in this section
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.

Selection in the GridControl

Figure 1: Selection in the GridControl

Samples:

C#: MouseButton-C#

VB: MouseButton-VB

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