Class GridGroupByField
Field which is part of each Select
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.GridView.dll
Syntax
public class GridGroupByField : NotifyPropertyBase, INotifyPropertyChangingEx, INotifyPropertyChanged
Remarks
Some of the GridGroupByField properties are meaningful only when present under
specific collection - Select
Examples
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
GridGroupByField()
Initializes a new instance of the GridGroupByField class.
Declaration
public GridGroupByField()
GridGroupByField(String)
Initializes a new instance of the GridGroupByField class with a name of a field.
Declaration
public GridGroupByField(string fieldName)
Parameters
System. The name of a field from the data source. |
GridGroupByField(String, Type)
Initializes a new instance of the GridGroupByField class with a name of a field and its data type.
Declaration
public GridGroupByField(string fieldName, Type dataType)
Parameters
System.
|
System.
|
Fields
aggregateResult
Declaration
protected object aggregateResult
Field Value
System.
|
DefaultFormatString
The default format string for the field.
Declaration
public static readonly string DefaultFormatString
Field Value
System.
|
FieldDefaultFormatString
The default format string for the field.
Declaration
public static readonly string FieldDefaultFormatString
Field Value
System.
|
Properties
Aggregate
Gets or sets aggregate function (from Grid
Declaration
public virtual GridAggregateFunction Aggregate { get; set; }
Property Value
Grid Returns the result from currently used aggregate function. This property defaults to GridAggregateFunction.None |
Remarks
Meaningful only for fields in the
Select
Examples
GridGroupByField gridGroupByField;
gridGroupByField = new GridGroupByField();
gridGroupByField.FieldName = "Freight";
gridGroupByField.HeaderText = "Total shipping cost is ";
gridGroupByField.Aggregate = GridAggregateFunction.Sum;
expression.SelectFields.Add( gridGroupByField );
Dim gridGroupByField As GridGroupByField
gridGroupByField = New GridGroupByField
gridGroupByField.FieldName = "Freight"
gridGroupByField.HeaderText = "Total shipping cost is "
gridGroupByField.Aggregate = GridAggregateFunction.Sum
expression.SelectFields.Add(gridGroupByField)
DataSourceNullValue
Gets or sets a value to be stored in the data source if the control value is null or empty.
Declaration
public virtual object DataSourceNullValue { get; set; }
Property Value
System.
|
DataType
Gets or sets the data type of the field.
Declaration
public virtual Type DataType { get; set; }
Property Value
System.
|
Expression
Gets or sets an expression for this field.
Declaration
public virtual string Expression { get; set; }
Property Value
System.
|
FieldAlias
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.
Declaration
public virtual string FieldAlias { get; set; }
Property Value
System. String representing the friendly name shown |
Remarks
Use this property for setting the field text that will be displayed in the
GridGroupHeaderItem. If this property is not set, the value of
Field
This property is useful in cases when:
Examples
GridGroupByField gridGroupByField;
//Add select fields (before the "Group By" clause)
gridGroupByField = new GridGroupByField();
gridGroupByField.FieldName = "EmployeeID";
gridGroupByField.FieldAlias = "EmployeeIdentificator";
expression.SelectFields.Add( gridGroupByField );
Dim gridGroupByField As GridGroupByField
'Add select fields (before the "Group By" clause)
gridGroupByField = New GridGroupByField
gridGroupByField.FieldName = "EmployeeID"
gridGroupByField.FieldAlias = "EmployeeIdentificator"
expression.SelectFields.Add(gridGroupByField)
FieldName
Gets or sets the name data source property or database column from a data source.
Declaration
public virtual string FieldName { get; set; }
Property Value
System.
|
Filter
Gets or sets the instance of Filter
Declaration
public virtual FilterExpression Filter { get; set; }
Property Value
FormatString
Declaration
public string FormatString { get; set; }
Property Value
System.
|
HeaderText
Gets or sets the expression that will be displayed in the
Grid
Declaration
public string HeaderText { get; set; }
Property Value
System. string, copied from the column's HeaderText if this group expression is based on a column. It defaults to the FieldAlias value (if specified). |
Remarks
Meaningful only for fields in the
Select
Examples
GridGroupByField gridGroupByField;
gridGroupByField = new GridGroupByField();
gridGroupByField.FieldName = "EmployeeID";
gridGroupByField.HeaderText = "EmployeeNo";
expression.SelectFields.Add( gridGroupByField );
Dim gridGroupByField As GridGroupByField
gridGroupByField = New GridGroupByField
gridGroupByField.FieldName = "EmployeeID"
gridGroupByField.HeaderText = "EmployeeNo"
expression.SelectFields.Add(gridGroupByField)
IsAggregate
Gets boolean value indicating whether the current GridGroupByField is an aggregate.
Declaration
public virtual bool IsAggregate { get; }
Property Value
System.
|
IsFieldAliasSet
Gets boolean value indicating whether FieldAlias is set.
When false, Field
Declaration
public virtual bool IsFieldAliasSet { get; }
Property Value
System.
|
IsFormatStringSet
Gets a value indicating whether the FormatString is set.
Declaration
public virtual bool IsFormatStringSet { get; }
Property Value
System.
|
IsHeaderTextSet
Gets boolean value indicating whether HeaderText is set.
When false, Header
Declaration
public bool IsHeaderTextSet { get; }
Property Value
System.
|
NullValue
Gets or sets an object to be set as the control property when the data source contains a DBNull value.
Declaration
public virtual object NullValue { get; set; }
Property Value
System.
|
SortOrder
Gets or sets the value indicating how the data will be sorted. Acceptable values
are the values of Rad
Declaration
public virtual RadSortOrder SortOrder { get; set; }
Property Value
Rad Returns the sorting mode applied to the grouped data. By default it is Ascending. |
Remarks
Meaningful only for fields in the
Group
Examples
GridGroupByField gridGroupByField;
gridGroupByField = new GridGroupByField();
gridGroupByField.FieldName = "EmployeeID";
gridGroupByField.SortOrder = GridSortOrder.Descending;
expression.GroupByFields.Add( gridGroupByField );
Dim gridGroupByField As GridGroupByField
gridGroupByField = New GridGroupByField
gridGroupByField.FieldName = "EmployeeID"
gridGroupByField.SortOrder = GridSortOrder.Descending
expression.GroupByFields.Add(gridGroupByField)
Methods
CopyFrom(GridGroupByField)
Inherited but not used
Declaration
public void CopyFrom(GridGroupByField field)
Parameters
Grid
|
GenerateFieldAlias()
Generates a string value representing the alias of the field based on the Field
Declaration
protected string GenerateFieldAlias()
Returns
System. A string value representing the alias of the field. |
GetHeaderText()
Method which gets the HeaderText value from GridGroupByField part
of the Select
Declaration
public string GetHeaderText()
Returns
System. String containing the HeaderText value |
Remarks
Meaningful only for GridGroupByFields from the
Select
Examples
Dim groupExpression As GridGroupByExpression = RadGrid1.MasterTableView.GroupByExpressions(0)
Dim headerText as String = groupExpression.SelectFields(0).GetHeaderText()
GridGroupByExpression groupExpression = RadGrid1.MasterTableView.GroupByExpressions[0] as GridGroupByExpression;
String headerText = groupExpression.SelectFields[0].GetHeaderText()
IsReferredAs(String)
Each Gridname
Declaration
public bool IsReferredAs(string name)
Parameters
System. The name that is to be checked against. |
Returns
System. true if the current field can be referred as |
ResetFieldAliasCache()
Declaration
protected void ResetFieldAliasCache()
SetAggregate(String)
Method setting the aggregate function applied for a
GridGroupByField which is part of the
Select
Declaration
public virtual void SetAggregate(string value)
Parameters
System.
|
Remarks
Meaningful only for GridGroupByFields from the
Select
Examples
Dim groupExpression As GridGroupByExpression = New GridGroupByExpression()
Dim groupByField As GridGroupByField = New GridGroupByField()
groupByField.FieldName = "Size"
groupByField.SetAggregate(GridAggregateFunction.Sum)
groupExpression.SelectFields.Add(groupByField)
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.FieldName = "Size";
groupByField.SetAggregate(GridAggregateFunction.Sum);
groupExpression.SelectFields.Add(groupByField);
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);
SetSortOrder(String)
Method setting the sort order applied for a GridGroupByField which
is part of the Group
Declaration
public void SetSortOrder(string SortOrder)
Parameters
System.
|
Remarks
Meaningful only for GridGroupByFields from the
Group
Examples
GridGroupByExpression groupExpression = new GridGroupByExpression();
groupByField = new GridGroupByField();
groupByField.FieldName = "Received";
groupExpression.SelectFields.Add(groupByField);
groupByField = new GridGroupByField();
groupByField.FieldName = "Received";
groupByField.SetSortOrder(GridSortOrder.Ascending);
groupExpression.GroupByFields.Add(groupByField);
RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression);
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"
groupByField.SetSortOrder(GridSortOrder.Descending)
groupExpression.GroupByFields.Add(groupByField)
RadGrid1.MasterTableView.GroupByExpressions.Add(groupExpression)
ToGroupByString()
Declaration
public string ToGroupByString()
Returns
System.
|
ToGroupByString(Boolean)
Declaration
public string ToGroupByString(bool preferAlias)
Parameters
System.
|
Returns
System.
|
ToSelectString()
Declaration
public string ToSelectString()
Returns
System.
|
ToSelectString(String)
Converts to string considering the specific format.
Declaration
public string ToSelectString(string defaultFormatString)
Parameters
System. The default format string. |
Returns
System.
|
ToString()
Method that retrieves a System.String that indicates the current object
Declaration
public override string ToString()
Returns
System. The string format of the object. |
Overrides
UpdateFormatString(Boolean, Boolean)
Declaration
public virtual string UpdateFormatString(bool doubleQuote, bool forceChange)
Parameters
System.
|
System.
|
Returns
System.
|
UpdateFormatString(String, Boolean, Boolean)
Declaration
public static string UpdateFormatString(string formatString, bool doubleQuote, bool forceChange)
Parameters
System.
|
System.
|
System.
|
Returns
System.
|
Validate()
Inherited but not used
Declaration
public virtual void Validate()
ValidateFormatString()
Declaration
public virtual int ValidateFormatString()
Returns
System.
|
ValidateFormatString(String)
Declaration
public static int ValidateFormatString(string formatString)
Parameters
System.
|
Returns
System.
|