Class GridSummaryRowDescriptor
A GridSummaryRowDescriptor declares a summary row with one or multiple GridSummaryColumnDescriptor elements. GridSummaryRowDescriptor descriptors are managed by the GridSummaryRowDescriptorCollection which is returned by the SummaryRows property of a GridTableDescriptor.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid.Grouping
Assembly: Syncfusion.Grid.Grouping.Windows.dll
Syntax
public class GridSummaryRowDescriptor : DescriptorBase, ICustomTypeDescriptor, IDisposable, ICloneable, IItemPropertiesSource, IGridTableCellAppearanceSource
Remarks
Each group in the GridTable has a summary section. The summary section has as many rows as there are GridSummaryRowDescriptors that are visible. Each GridSummaryRowDescriptor has a collection of GridSummaryColumnDescriptor columns. The GridSummaryColumnDescriptor defines the GridColumnDescriptor to calculate summary information for the SummaryType and the target column where the summary should be displayed in the grid.
See also the Grid\Grouping\CustomSummary example for setting up custom summaries.
Examples
The following example shows how to set up a summary:
' Setup a integrated summary
Dim sd0 As New GridSummaryColumnDescriptor()
sd0.DataMember = "Quantity"
sd0.DisplayColumn = "Quantity"
sd0.Format = "{Average:#.00}"
sd0.SummaryType = SummaryType.DoubleAggregate
Me.gridGroupingControl1.TableDescriptor.SummaryRows.Add(New GridSummaryRowDescriptor("Row 0", "Average", sd0))
// Setup a integrated summary
GridSummaryColumnDescriptor sd0 = new GridSummaryColumnDescriptor();
sd0.DataMember = "Quantity";
sd0.DisplayColumn = "Quantity";
sd0.Format = "{Average:#.00}";
sd0.SummaryType = SummaryType.DoubleAggregate;
this.gridGroupingControl1.TableDescriptor.SummaryRows.Add(new GridSummaryRowDescriptor("Row 0", "Average", sd0));
Constructors
GridSummaryRowDescriptor()
Initializes a new empty descriptor.
Declaration
public GridSummaryRowDescriptor()
GridSummaryRowDescriptor(String)
Initializes a new descriptor with a row name.
Declaration
public GridSummaryRowDescriptor(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The row name. |
GridSummaryRowDescriptor(String, GridSummaryColumnDescriptor)
Initializes a new descriptor with a row name and a collection of GridSummaryColumnDescriptors.
Declaration
public GridSummaryRowDescriptor(string name, GridSummaryColumnDescriptor summary)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The row name. |
GridSummaryColumnDescriptor | summary | A GridSummaryColumnDescriptor |
GridSummaryRowDescriptor(String, GridSummaryColumnDescriptor[])
Initializes a new descriptor with a row name and a collection of GridSummaryColumnDescriptors.
Declaration
public GridSummaryRowDescriptor(string name, GridSummaryColumnDescriptor[] summaries)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The row name. |
GridSummaryColumnDescriptor[] | summaries | A collection of GridSummaryColumnDescriptor |
GridSummaryRowDescriptor(String, String, GridSummaryColumnDescriptor)
Initializes a new descriptor with a row name, title, and collection of GridSummaryColumnDescriptors.
Declaration
public GridSummaryRowDescriptor(string name, string title, GridSummaryColumnDescriptor summary)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The row name. |
System.String | title | A summary row title. A title is displayed at the left-most cell of that row. |
GridSummaryColumnDescriptor | summary | A GridSummaryColumnDescriptor. |
GridSummaryRowDescriptor(String, String, GridSummaryColumnDescriptor[])
Initializes a new descriptor with a row name, title, and collection of GridSummaryColumnDescriptors.
Declaration
public GridSummaryRowDescriptor(string name, string title, GridSummaryColumnDescriptor[] summaries)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The row name. |
System.String | title | A summary row title. A title is displayed at the left-most cell of that row. |
GridSummaryColumnDescriptor[] | summaries | A collection of GridSummaryColumnDescriptors. |
GridSummaryRowDescriptor(String, String, Int32, GridSummaryColumnDescriptor[])
Initializes a new descriptor with a row name, title, titleColumnCount and collection of GridSummaryColumnDescriptors.
Declaration
public GridSummaryRowDescriptor(string name, string title, int titleColCount, GridSummaryColumnDescriptor[] summaries)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The row name. |
System.String | title | A summary row title. A title is displayed at the left-most cell of that row. |
System.Int32 | titleColCount | TitleColumnCount of the title to be shown in Summary row. |
GridSummaryColumnDescriptor[] | summaries | A GridSummaryColumnDescriptor. |
Properties
Appearance
Gets or sets the default GridTableCellAppearance with default GridTableCellStyleInfo information for all cell elements that display data of this summary row.
Declaration
public GridTableCellAppearance Appearance { get; set; }
Property Value
Type |
---|
GridTableCellAppearance |
Collection
Gets the collection this descriptor belongs to.
Declaration
public GridSummaryRowDescriptorCollection Collection { get; }
Property Value
Type |
---|
GridSummaryRowDescriptorCollection |
Engine
Gets the GridEngine that this summary column descriptor belongs to.
Declaration
public GridEngine Engine { get; }
Property Value
Type |
---|
GridEngine |
IsFillRow
Gets whether this row displays summary columns in grid cells below a certain header column or if the summary row is one large covered cell that spans the whole row.
Declaration
public bool IsFillRow { get; }
Property Value
Type |
---|
System.Boolean |
Name
Gets or sets the name of this descriptor. This name is used to look up the summary in the GridSummaryRowDescriptorCollection.
Declaration
public virtual string Name { get; set; }
Property Value
Type |
---|
System.String |
SummaryColumns
Gets the collection of GridSummaryColumnDescriptor elements.
Declaration
public GridSummaryColumnDescriptorCollection SummaryColumns { get; }
Property Value
Type |
---|
GridSummaryColumnDescriptorCollection |
TableDescriptor
Gets the TableDescriptor that this descriptor belongs to.
Declaration
public GridTableDescriptor TableDescriptor { get; }
Property Value
Type |
---|
GridTableDescriptor |
Title
Gets or sets the title text to be displayed in the column title.
Declaration
public string Title { get; set; }
Property Value
Type |
---|
System.String |
TitleColumnCount
Gets or sets the number of columns that the Title should span. Specify 0 if no title should be displayed.
Declaration
public int TitleColumnCount { get; set; }
Property Value
Type |
---|
System.Int32 |
Visible
Gets or sets whether the row should be visible in the grid. If you set this property to False, the row will not show up but you can still reference the summary columns from a caption bar in the CaptionText of a GridGroupOptionsStyleInfo as a custom summary token.
Declaration
public bool Visible { get; set; }
Property Value
Type |
---|
System.Boolean |
Methods
Clone()
Creates a copy of this descriptor.
Declaration
public GridSummaryRowDescriptor Clone()
Returns
Type | Description |
---|---|
GridSummaryRowDescriptor | A copy of this descriptor. |
Dispose(Boolean)
Disposes the unmanaged resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
Equals(Object)
Determines whether the specified System.Object is equal to the current System.Object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with the current System.Object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified System.Object is equal to the current System.Object; otherwise, false. |
Overrides
GetHashCode()
Serves as a hash function for a particular type.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current object. |
Overrides
GetName()
Gets the name of the descriptor.
Declaration
public override string GetName()
Returns
Type | Description |
---|---|
System.String | Descriptor name. |
Overrides
GetSummaryColumnAtCol(Int32)
Returns the GridSummaryColumnDescriptor that is displayed at the zero-based grid column position.
Declaration
public GridSummaryColumnDescriptor GetSummaryColumnAtCol(int col)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | col | The column index. |
Returns
Type | Description |
---|---|
GridSummaryColumnDescriptor | The GridSummaryColumnDescriptor. |
Examples
The GridTableControl calls this method to determine which summary column to display at a specific grid column index. Given a grid cell rowIndex and colIndex, the grid calls
fieldNum = TableDescriptor.ColIndexToField(colIndex);
GridSummaryColumnDescriptor sc = sr.SummaryRowDescriptor.GetSummaryColumnAtCol(fieldNum);
InitializeFrom(GridSummaryRowDescriptor)
Initializes this object and copies properties from another object. PropertyChanging and PropertyChanged events are raised for every property that is modified. If both objects are equal, no events are raised.
Declaration
public void InitializeFrom(GridSummaryRowDescriptor other)
Parameters
Type | Name | Description |
---|---|---|
GridSummaryRowDescriptor | other | The source object. |
OnPropertyChanged(DescriptorPropertyChangedEventArgs)
Raises the PropertyChanged event.
Declaration
protected virtual void OnPropertyChanged(DescriptorPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DescriptorPropertyChangedEventArgs | e | A DescriptorPropertyChangedEventArgs that contains the event data. |
OnPropertyChanging(DescriptorPropertyChangedEventArgs)
Raises the PropertyChanging event.
Declaration
protected virtual void OnPropertyChanging(DescriptorPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DescriptorPropertyChangedEventArgs | e | A DescriptorPropertyChangedEventArgs that contains the event data. |
ResetAppearance()
Discards any changes for the Appearance object.
Declaration
public void ResetAppearance()
ResetDisplayColumns()
Internal only.
Declaration
public void ResetDisplayColumns()
ResetTitle()
Resets the title text.
Declaration
public void ResetTitle()
ResetTitleColumnCount()
Resets the titleColumnCount text.
Declaration
public void ResetTitleColumnCount()
ResetVisible()
Resets Visible property to be True.
Declaration
public void ResetVisible()
ShouldSerializeAppearance()
Determines whether Appearance has been modified and contents should be serialized at design-time.
Declaration
public bool ShouldSerializeAppearance()
Returns
Type | Description |
---|---|
System.Boolean | True if contents were changed; False otherwise. |
ShouldSerializeTitle()
Determines whether Title has been modified and its value should be serialized at design-time.
Declaration
public bool ShouldSerializeTitle()
Returns
Type | Description |
---|---|
System.Boolean | True if contents were changed; False otherwise. |
ShouldSerializeTitleColumnCount()
Determines whether TitleColumnCount has been modified and its value should be serialized at design-time.
Declaration
public bool ShouldSerializeTitleColumnCount()
Returns
Type | Description |
---|---|
System.Boolean | True if contents were changed; False otherwise. |
ShouldSerializeVisible()
Determines whether Visible has been set to False and its value should be serialized at design-time.
Declaration
public bool ShouldSerializeVisible()
Returns
Type | Description |
---|---|
System.Boolean | True if contents were changed; False otherwise. |
ToString()
Returns a string holding the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representation of the current object. |
Overrides
Events
PropertyChanged
Occurs when a property is changed.
Declaration
public event DescriptorPropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
DescriptorPropertyChangedEventHandler |
PropertyChanging
Occurs before a property is changed.
Declaration
public event DescriptorPropertyChangedEventHandler PropertyChanging
Event Type
Type |
---|
DescriptorPropertyChangedEventHandler |
Explicit Interface Implementations
IItemPropertiesSource.GetItemProperties()
Declaration
PropertyDescriptorCollection IItemPropertiesSource.GetItemProperties()
Returns
Type |
---|
System.ComponentModel.PropertyDescriptorCollection |
IGridTableCellAppearanceSource.GetAppearance()
Declaration
GridTableCellAppearance IGridTableCellAppearanceSource.GetAppearance()
Returns
Type |
---|
GridTableCellAppearance |
IGridTableCellAppearanceSource.GetBaseAppearance()
Declaration
GridTableCellAppearance IGridTableCellAppearanceSource.GetBaseAppearance()
Returns
Type |
---|
GridTableCellAppearance |
IGridTableCellAppearanceSource.RaiseAppearanceChanged(GridTableCellStyleInfoChangedEventArgs)
Declaration
void IGridTableCellAppearanceSource.RaiseAppearanceChanged(GridTableCellStyleInfoChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridTableCellStyleInfoChangedEventArgs | e |
IGridTableCellAppearanceSource.RaiseAppearanceChanging(GridTableCellStyleInfoChangedEventArgs)
Declaration
void IGridTableCellAppearanceSource.RaiseAppearanceChanging(GridTableCellStyleInfoChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridTableCellStyleInfoChangedEventArgs | e |
ICloneable.Clone()
Declaration
object ICloneable.Clone()
Returns
Type |
---|
System.Object |