Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Group Rows in Code

In This Article

#Grouping

To group data by the values of the 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, 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.

Note

The GridViewBase.AllowGrouping property specifies whether an end user can group data. Setting this property to false does not ungroup data.