ComponentOne GridView for ASP.NET AJAX: Using GridView for ASP.NET AJAX > Grouping

Grouping

The C1GridView data grouping features allow you to automatically calculate data aggregates and create trees with nodes that can be collapsed and expanded.

At run time, users can group data if the AllowGrouping property has been set to True (by default it is set to False). If AllowGrouping had is True, a grouping area will appear at the top of the grid:

 

 

To group at run time, simply drag a column header into the grouping area. Note that you may need to set the AllowColMoving property to True to allow run-time column manipulation.

The C1GridView data grouping features are controlled by two properties of the C1Field class:

      The GroupInfo property determines whether a group should be created for the column, as well as the appearance, position, and content of the group header and group footer rows.

      The Aggregate property determines the type of aggregate that should be calculated for this column and included in the group header and footer rows.

Typically, you will set the GroupInfo property for columns that contain categories that you would like to group on (for example, OrderYear, Country, and so on). You will set the Aggregate property for columns that contain the values that you want to aggregate on (for example, Amount, Sales, Expenses, and so on).

You can customize the text that appears in the grouping area by setting the GroupByCaption property.


Setting Grouping Properties at Design Time

Setting Grouping Properties at Run Time

Collapsing and Expanding Groups


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.