Articles in this section
Category / Section

What are the two selection types in WinForms GridGroupingControl?

1 min read

Selection types

There are two selection types in the GridGroupingControl, they are

1. Range selection (cell-based selection)

2. Record selection

Range selection

You can turn on this selection by setting the grid.tableOptions.AllowSelections to something other than “None”. By this selection, you can select range of cells/columns/rows. This selection functionality raises events like the grid.TableModel.SelectionChanging/Changed.

C#

//Inherited GridControlBase Selection
this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any;

VB

'Inherited GridControlBase Selection
Me.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any

The following screenshots illustrates range selection.

Show the range selection types

Figure 1: Range selection (Cell based selection)

Record selection

This selection is a record based selection support that is specific to the GridGroupingControl. You can turn on this selection support by setting the grid.TableOptions.AllowSelections to “None” and setting the grid.TableOptions.ListBoxSelectionMode to something other than “None”. This selection support raises the grid.SelectedRecordsChanged/Changing rather than raising the grid.TableModel.SelectionChanging/Changed events.

C#

//Record based Selection
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = System.Windows.Forms.SelectionMode.One;

VB

'Record based Selection
Me.gridGroupingControl1.TableOptions.ListBoxSelectionMode = System.Windows.Forms.SelectionMode.One

The following screenshots illustrates record selection.

Show record based selection

Figure 2: Record based selection

Note:

The default value of the gridGroupingControl1.TableOptions.AllowSelection is “None”. With this, you can able to select the current cell alone.

Samples:

C#: SelectionModesInGGC

VB: SelectionModesInGGC

Reference link: https://help.syncfusion.com/windowsforms/gridgrouping/selections

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