New to Telerik UI for WinFormsStart a free 30-day trial

Field which is part of each SelectFields and GroupByFields collection

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.GridView.dll

Syntax:

C#
public class GridGroupByField : NotifyPropertyBase, INotifyPropertyChangingEx, INotifyPropertyChanged

Inheritance: objectNotifyPropertyBaseGridGroupByField

Implements: INotifyPropertyChangedINotifyPropertyChangingEx

Inherited Members NotifyPropertyBase.SuspendNotifications()NotifyPropertyBase.ResumeNotifications(bool)NotifyPropertyBase.ResumeNotifications()NotifyPropertyBase.OnPropertyChanged(string)NotifyPropertyBase.OnPropertyChanged(PropertyChangedEventArgs)NotifyPropertyBase.ProcessPropertyChanged(PropertyChangedEventArgs)NotifyPropertyBase.OnPropertyChanging(string, object, object)NotifyPropertyBase.OnPropertyChanging(string)NotifyPropertyBase.OnPropertyChanging(PropertyChangingEventArgsEx)NotifyPropertyBase.ProcessPropertyChanging(PropertyChangingEventArgsEx)NotifyPropertyBase.SetProperty<T>(string, ref T, T)NotifyPropertyBase.IsSuspendedNotifyPropertyBase.PropertyChangedNotifyPropertyBase.PropertyChanging...

Constructors

Initializes a new instance of the GridGroupByField class.

C#
public GridGroupByField()

Initializes a new instance of the GridGroupByField class with a name of a field and its data type.

C#
public GridGroupByField(string fieldName, Type dataType)
Parameters:fieldNamestringdataTypeType

Initializes a new instance of the GridGroupByField class with a name of a field.

C#
public GridGroupByField(string fieldName)
Parameters:fieldNamestring

The name of a field from the data source.

Fields

C#
protected object aggregateResult

The default format string for the field.

C#
public static readonly string DefaultFormatString

The default format string for the field.

C#
public static readonly string FieldDefaultFormatString

Properties

Gets or sets aggregate function (from GridAggregateFunction enumeration values) that will be applied on the grouped data.

C#
[Browsable(true)]
public virtual GridAggregateFunction Aggregate { get; set; }
Property Value:

Returns the result from currently used aggregate function. This property defaults to GridAggregateFunction.None

Remarks:

Meaningful only for fields in the SelectFields collection.

Gets or sets a value to be stored in the data source if the control value is null or empty.

C#
[Browsable(false)]
public virtual object DataSourceNullValue { get; set; }

Gets or sets the data type of the field.

C#
[Browsable(false)]
public virtual Type DataType { get; set; }

Gets or sets an expression for this field.

C#
public virtual string Expression { get; set; }

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.

C#
[Browsable(true)]
public virtual string FieldAlias { get; set; }
Property Value:

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 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 FieldName column value)
    or
  • group by a template column and RadGridView cannot get the header text for that column.

Gets or sets the name data source property or database column from a data source.

C#
[Browsable(true)]
public virtual string FieldName { get; set; }

Gets or sets the instance of FilterExpression for this field.

C#
public virtual FilterExpression Filter { get; set; }
C#
public string FormatString { get; set; }

Gets or sets the expression that will be displayed in the GridGroupHeaderItem.

C#
public string HeaderText { get; set; }
Property Value:

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 SelectFields collection. When rendering RadGrid will override the FieldAlias value with the HeaderText specified.

Gets boolean value indicating whether the current GridGroupByField is an aggregate.

C#
[Browsable(false)]
public virtual bool IsAggregate { get; }

Gets boolean value indicating whether FieldAlias is set. When false, FieldAlias will return 'Aggregate of FieldName' if the current group-by field is an aggregate, 'FieldName' otherwise.

C#
[Browsable(false)]
public virtual bool IsFieldAliasSet { get; }

Gets a value indicating whether the FormatString is set.

C#
[Browsable(false)]
public virtual bool IsFormatStringSet { get; }

Gets boolean value indicating whether HeaderText is set. When false, HeaderText will return FieldAlias

C#
[Browsable(false)]
public bool IsHeaderTextSet { get; }

Gets or sets an object to be set as the control property when the data source contains a DBNull value.

C#
[Browsable(false)]
public virtual object NullValue { get; set; }

Gets or sets the value indicating how the data will be sorted. Acceptable values are the values of RadSortOrder enumeration (Ascending, Descending and None).

C#
[Browsable(true)]
public virtual RadSortOrder SortOrder { get; set; }
Property Value:

Returns the sorting mode applied to the grouped data. By default it is Ascending.

Remarks:

Meaningful only for fields in the GroupByFields collection.

Methods

Inherited but not used

C#
public void CopyFrom(GridGroupByField field)
Parameters:fieldGridGroupByField

Generates a string value representing the alias of the field based on the FieldName.

C#
protected string GenerateFieldAlias()
Returns:

string

A string value representing the alias of the field.

Method which gets the HeaderText value from GridGroupByField part of the SelectFields collection

C#
public string GetHeaderText()
Returns:

string

String containing the HeaderText value

Remarks:

Meaningful only for GridGroupByFields from the SelectFields collection

Each GridGroupByField can be referenced using FieldName and FieldAlias This method checks whether the current GridGroupByField's FieldName or FieldAlias match the given name

C#
public bool IsReferredAs(string name)
Parameters:namestring

The name that is to be checked against.

Returns:

bool

true if the current field can be referred as name, else otherwise

C#
protected void ResetFieldAliasCache()

Method setting the aggregate function applied for a GridGroupByField which is part of the SelectFields collection.

C#
public virtual void SetAggregate(string value)
Parameters:valuestring
Remarks:

Meaningful only for GridGroupByFields from the SelectFields collection

Method setting the sort order applied for a GridGroupByField which is part of the GroupByFields collection.

C#
public void SetSortOrder(string SortOrder)
Parameters:SortOrderstring
Remarks:

Meaningful only for GridGroupByFields from the GroupByFields collection

C#
public string ToGroupByString()
Returns:

string

C#
public string ToGroupByString(bool preferAlias)
Parameters:preferAliasboolReturns:

string

C#
public string ToSelectString()
Returns:

string

Converts to string considering the specific format.

C#
public string ToSelectString(string defaultFormatString)
Parameters:defaultFormatStringstring

The default format string.

Returns:

string

Method that retrieves a System.String that indicates the current object

C#
public override string ToString()
Returns:

string

The string format of the object.

Overrides: object.ToString()

C#
public virtual string UpdateFormatString(bool doubleQuote, bool forceChange)
Parameters:doubleQuoteboolforceChangeboolReturns:

string

C#
public static string UpdateFormatString(string formatString, bool doubleQuote, bool forceChange)
Parameters:formatStringstringdoubleQuoteboolforceChangeboolReturns:

string

Inherited but not used

C#
public virtual void Validate()
C#
public virtual int ValidateFormatString()
Returns:

int

C#
public static int ValidateFormatString(string formatString)
Parameters:formatStringstringReturns:

int