Skip to main content

Grouping in Code

#Grouping

To group data by the values of a specified column at runtime, do one of the following:

  • Specify the column's GridColumn.GroupIndex property. This property specifies whether the column takes part in grouping or not, and at which level.

    
    grid.Columns["UnitPrice"].GroupIndex = 0;
    
  • Use the GridControl.GroupBy method.

    
    grid.GroupBy("UnitPrice");
    

#Ungrouping

To ungroup data by the values of a single column, do one of the following:

To ungroup the grid, use the GridControl.ClearGrouping method.

#Example: How to Group Data By Multiple Columns