GridGroupByField
Field which is part of each SelectFields and GroupByFields collection
Some of the GridGroupByField properties are meaningful only when present under specific collection - SelectFields or GroupByFields
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class GridGroupByField
Inheritance: objectGridGroupByField
Inherited Members
Example:
Dim groupExpression As GridGroupByExpression = New GridGroupByExpression()
Dim groupByField As GridGroupByField = New GridGroupByField()
groupByField = New GridGroupByField()
groupByField.FieldName = "Received"
groupExpression.SelectFields.Add(groupByField)
groupByField = New GridGroupByField()
groupByField.FieldName = "Received"
groupExpression.GroupByFields.Add(groupByField)
RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression)
GridGroupByExpression groupExpression = new GridGroupByExpression();
GridGroupByField groupByField = new GridGroupByField();
groupByField = new GridGroupByField();
groupByField.FieldName = "Received";
groupExpression.SelectFields.Add(groupByField);
groupByField = new GridGroupByField();
groupByField.FieldName = "Received";
groupExpression.GroupByFields.Add(groupByField);
RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression);
Constructors
public GridGroupByField()
Properties
Gets or sets aggregate function (from GridAggregateFunction enumeration values) that will be applied on the grouped data.
public GridAggregateFunction Aggregate { get; set; }
Returns the result from currently used aggregate function. This property defaults to GridAggregateFunction.None
Meaningful only for fields in the SelectFields collection.
Gets or sets a value representing a friendly name for the field used for forming the group by expression. This name will be displayed in each group header when grouping by the respective field.
public string FieldAlias { get; set; }
String representing the friendly name shown
Use this property for setting the field text that will be displayed in the GridGroupHeaderItem. If this property is not set, the value of FieldName property will be used. Note that this property has a meaning only for GridGroupByField part of the SelectFields of GridGroupByExpression.
This property is useful in cases when:
- you want to change the value displayed in group header (different than the default DataField column value)
or- group by a template column and Telerik RadGrid cannot get the header text for that column.
Gets or sets a string that represents the DataField column property that will be used to form the GroupByExpression.
public string FieldName { get; set; }
String representing the DataField for the corresponding grouped column
Unless you have specified a FieldAlias, the value of this property will be used when Telerik RadGrid constructs the text for GridGroupHeaderItem. FieldName has a meaning both for SelectFields and GroupByFields of GroupByExpression.
Gets or sets the string that will be used to format the GridGroupByField part of the SelectFields collection.
public string FormatString { get; set; }
String, formated by the GridGroupByField's FormatString property. It defaults to: "{0}".
Meaningful only for fields in the SelectFields collection.
When rendering RadGrid is using this expression to format field's value. It is mandatory that {0} parameter is specified in the string - it will be replaced with field's runtime value.
Gets or sets the expression that will be displayed in the GridGroupHeaderItem.
public string HeaderText { get; set; }
string, copied from the column's HeaderText if this group expression is based on a column. It defaults to the FieldAlias value (if specified).
Meaningful only for fields in the SelectFields collection. When rendering RadGrid will override the FieldAlias value with the HeaderText specified.
Gets or sets the string that separates header text from value text as the field is rendered in the GroupHeaderItems.
public string HeaderValueSeparator { get; set; }
string, represents the separator between the header text and value text.
This field value defaults to ": ".
Meaningful only for fields in the SelectFields collection.
Gets or sets the value representing how the data will be sorted. Acceptable values are the values of GridSortOrder enumeration except for None (Ascending, Descending).
public GridSortOrder SortOrder { get; set; }
Returns the sorting mode applied to the grouped data. By default it is Ascending.
Meaningful only for fields in the GroupByFields collection. 'None' value is not supported because it can not determine uniquely the order in which the groups will be displayed.
Methods
Inherited but not used
Method which gets the FormatString value from GridGroupByField part of the SelectFields collection
public string GetFormatString()
String containing the FormatString value
Meaningful only for GridGroupByFields from the SelectFields collection
Method which gets the HeaderText value from GridGroupByField part of the SelectFields collection
public string GetHeaderText()
String containing the HeaderText value
Meaningful only for GridGroupByFields from the SelectFields collection
Method setting the aggregate function applied for a GridGroupByField which is part of the SelectFields collection.
public void SetAggregate(string value)
Meaningful only for GridGroupByFields from the SelectFields collection
Method setting the sort order applied for a GridGroupByField which is part of the GroupByFields collection.
public void SetSortOrder(string SortOrder)
Meaningful only for GridGroupByFields from the GroupByFields collection
Method that retrieves a System.String that indicates the current object
Inherited but not used
public void Validate()