This example demonstrates how GroupByExpressions can be used in Telerik RadGrid:
Creating group-by expressions - GridGroupByField Properties:
- FieldName: name of any field from the DataSource
- FieldAlias: alias string. This cannot contain blanks or other reserved symbols like ',', '.' etc.
- Aggregate: any of - min, max, sum, count, last, first etc (the same as in GridAggregateFunction enumeration)
- SortOrder: acs or desc - the sort order of the grouped items
- HeaderText: specifies the name to use for the field when it appears in the group header and in the group panel. This property lets you specify a field name that includes blanks or reserved characters. This property is only used for fields in the SelectFields collection. Meaningful for items from the SelectFields collection only.
- FormatString: specifies a format string for formatting field values when they appear in the group header. This property is only used for fields in the SelectFields collection. Meaningful for items from the SelectFields collection only.
- HeaderValueSeparator: specifies a string that appears in the group header between the header text and the value (or aggregated value). This property is only used for fields in the SelectFields collection. Meaningful for items from the SelectFields collection only.
Note that grouping is not supported with simple data-binding (calling DataBind()). See the
Simple data binding demo from the
Populating with data section for more info about the limitations of this binding mode.