How to Group a Column Programmatically

3 Jan 2020 / 1 minute to read

To group a column programmatically, use the following code.

//Shows the GroupDropArea.
this.gridGroupingControl1.ShowGroupDropArea = true;

//Groups by "Col1".
this.gridGroupingControl1.TableDescriptor.GroupedColumns.Add("Col1", ListSortDirection.Ascending);
'Shows the GroupDropArea.
Me.gridGroupingControl1.ShowGroupDropArea = True

'Groups by "Col1".
Me.gridGroupingControl1.TableDescriptor.GroupedColumns.Add("Col1", ListSortDirection.Ascending)