Expression similar to SQL's "Select Group By" clause that is used by GridTableView to group items . Expressions can be defined by assigning Expression property and/or managing the items in SelectFields or GroupByFields collections.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.GridView.dll
Syntax:
public class GridGroupByExpression : GroupDescriptor, INotifyPropertyChanged
Inheritance: objectGroupDescriptorGridGroupByExpression
Implements:
Inherited Members
Constructors
Initializes a new instance of the GridGroupByExpression class.
public GridGroupByExpression()
Constructs a new GroupByExpression from a grid GridColumn.
public GridGroupByExpression(GridViewDataColumn column)
the column (and its FieldName respectively) that will be used for grouping RadGridView
The AllowGroup of the column should be true. The following properties will be copied from the corresponding column's properties:
Initializes a new instance of the GridGroupByExpression class.
Initializes a new instance of the GridGroupByExpression class.
Fields
public const string GroupByClause = "Group By"
Properties
Gets or Sets the format string that is applied to group expressions that have no explicitly specified format string.
public string DefaultFormatString { get; set; }
String representation of the GroupBy expression. See Remarks for details.
public override string Expression { get; set; }
Overrides:
Create group-by expressions, using the following expression syntax:
fieldname[ as alias] [format "..."]|aggregate(fieldname|alias)[as alias][, ...]
Group By fieldname|alias [ASC|DESC]
Where:
fieldname: name of any field from the DataSource
alias: 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)
formatstring identical to the one used with string.Format, where the
first argument is the field name or the alias and the second one is the actual
value. The default value is "{0}: {1}"
Example: Country, City, count(Country) Items, ContactName Group By
Country, City desc
Gets a collection of GridGroupByField objects that form the grouping clause. Standing on the right side of the "Group By" clause
[Browsable(false)]
public GridGroupByFieldCollection GroupByFields { get; }
Gets the index of the expression if added in a GridGroupByExpressionCollection
[Browsable(false)]
public int Index { get; }
integer, representing the index of the collection ni GridGroupByExpressionCollection.
Gets a collection of SelectField objects (field names, aggregates etc.) that form the "Select" clause. Standing on the left side of the "Group By" clause.
[Browsable(false)]
public GridGroupByFieldCollection SelectFields { get; }
Methods
Checks if the given expression contains same Group-By field as this one.
public bool ContainsSameGroupByField(GridGroupByExpression expression)
Expression to check
Returns:true if the expression already contains this GroupByField, otherwise false.
Use this function to determine if two expressions seem to produce the same set of results
Copies from the passed GridGroupByExpression.
public void CopyFrom(GridGroupByExpression expression)
The expression.
Compares the current expression against the expression set as parameter and check if both expressions contain field with the same name.
public bool IsSame(GridGroupByExpression expression)
expression to check against this expression
Returns:true if both expressions contain field with the same name, otherwise false.
Calls GridGroupByExpression(expression)
The same as the Expression property
public override string ToString()
the string representation of the expression.
Overrides: