Class GridGroup
A Group defines a group of records that belong to a category. A group has multiple sections such as CaptionSection, SummarySection, GroupsDetailsSection, and RecordsDetailsSection.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid.Grouping
Assembly: Syncfusion.Grid.Grouping.Windows.dll
Syntax
public class GridGroup : Group, IDisposable, IDisposedEvent, IIsDisposedProperty, ITreeTableCounterSource, ITreeTableSummaryArraySource, IContainerElement, IElementTreeTableSource, IElement, IGridTableCellAppearanceSource, IGridGroupOptionsSource
Remarks
Groups are created when the records of the table are categorized or when a new record is inserted. Normally, the categories are based on the GroupedColumns but programmers can also provide their own categorization routines by implementing a Comparer for a SortColumnDescriptor. Before groups are categorized, the records are sorted in the order as specified by GroupedColumns. After the records were sorted, the Table object loops through all records to determine the categories records belong to.
Another collection in the TableDescriptor that defines categorization is the RelationChildColumns collection. RelationChildColumns will be added when there is a parent-child relation between two tables. The child table of such a relation must be sorted by the columns that are used to identify a record. These columns match the foreign key columns of the parent table. For every new category key with regards to RelationChildColumns, a ChildTable is created. The ChildTable class is derived from Group.
A group can either be a final node with records or it can be a node with nested groups. If a group has records, its Groups collection will be empty and the Records collection will contain all records. If a group has nested groups, its Groups collection will have the nested groups and the Records collection will be empty.
A group can be expanded and collapsed with its IsExpanded property. Expansion of groups will show or hide nested elements of the group within the DisplayElements collection.
A table has at least one group. The TopLevelGroup is a ChildTable which is derived from Group.
The GroupLevel property will return the group level how deep the group is nested.
Constructors
GridGroup(Section)
Initializes a new instance of the GridGroup class.
Declaration
public GridGroup(Section parent)
Parameters
Type | Name | Description |
---|---|---|
Section | parent | The parent element this object belongs to. |
Properties
Appearance
Gets or sets the default GridTableCellAppearance with GridTableCellStyleInfo information for cells of this element.
Declaration
public GridTableCellAppearance Appearance { get; set; }
Property Value
Type |
---|
GridTableCellAppearance |
Engine
Gets the engine this element belongs to.
Declaration
public GridEngine Engine { get; }
Property Value
Type |
---|
GridEngine |
EngineTable
Gets the GridTable of the engine this element belongs to.
Declaration
public GridTable EngineTable { get; }
Property Value
Type |
---|
GridTable |
GroupOptions
Lets you control the look of inner groups like whether the Caption Row is visible or what CaptionText is.
Declaration
public GridGroupOptionsStyleInfo GroupOptions { get; set; }
Property Value
Type |
---|
GridGroupOptionsStyleInfo |
HasGroupOptions
Gets the value of GroupOptions if it has specified.
Declaration
public bool HasGroupOptions { get; }
Property Value
Type |
---|
System.Boolean |
IsCollapsible
Determines whether this group can be collapsed.
Declaration
public override bool IsCollapsible { get; }
Property Value
Type |
---|
System.Boolean |
Overrides
ParentChildTable
Gets a reference to the child table this element belongs.
Declaration
public GridChildTable ParentChildTable { get; }
Property Value
Type |
---|
GridChildTable |
ParentRecord
Gets a reference to the parent record this element belongs to.
Declaration
public GridRecord ParentRecord { get; }
Property Value
Type |
---|
GridRecord |
ParentTable
Gets or sets a reference to the parent table this section belongs to.
Declaration
public GridTable ParentTable { get; set; }
Property Value
Type |
---|
GridTable |
ParentTableDescriptor
Gets the table descriptor this element belongs to.
Declaration
public GridTableDescriptor ParentTableDescriptor { get; }
Property Value
Type |
---|
GridTableDescriptor |
ReadGroupOptions
Gets the GroupOptions,If this element is modified; otherwise it returns a GridGroupOptionsStyleInfo of the first parent element with GroupOptions in the hierarchy.
Declaration
public GridGroupOptionsStyleInfo ReadGroupOptions { get; }
Property Value
Type |
---|
GridGroupOptionsStyleInfo |
ReadOnlyAppearance
Gets the Appearance if this element is modified; otherwise it returns a GridTableCellAppearance of the first parent element with appearance in the hierarchy.
Declaration
public GridTableCellAppearance ReadOnlyAppearance { get; }
Property Value
Type |
---|
GridTableCellAppearance |
UseCategoryColumnGroupOptions
Gets or sets this property to false if you are concerned about real-time updates performance.
Declaration
public static bool UseCategoryColumnGroupOptions { get; set; }
Property Value
Type |
---|
System.Boolean |
Methods
CreateGroupTypedListRecordsCollection()
Create the GroupTypedListRecordsCollection
Declaration
protected override GroupTypedListRecordsCollection CreateGroupTypedListRecordsCollection()
Returns
Type | Description |
---|---|
GroupTypedListRecordsCollection | returns the new GroupTypedListRecordsCollection |
Overrides
Dispose(Boolean)
Release the unmanaged resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
GetBaseAppearance()
Gets a GridTableCellAppearance of the first parent element with appearance in the hierarchy.
Declaration
public GridTableCellAppearance GetBaseAppearance()
Returns
Type | Description |
---|---|
GridTableCellAppearance |
GetGroupCaptionDisplayText(String)
Gets the caption text for a group using a specified format.
Declaration
public string GetGroupCaptionDisplayText(string format)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | See GroupOptions.CaptionText, e.g. "{CategoryCaption}: {Category} - {RecordCount} Items"; |
Returns
Type | Description |
---|---|
System.String | Caption text for the group. |
GetGroupCaptionText()
Gets the caption text for a group.
Declaration
public string GetGroupCaptionText()
Returns
Type | Description |
---|---|
System.String | Caption text for the group. |
GetSummaryText(GridSummaryColumnDescriptor)
Returns the formatted summary text for the given group and summary column.
Declaration
public string GetSummaryText(GridSummaryColumnDescriptor scd)
Parameters
Type | Name | Description |
---|---|---|
GridSummaryColumnDescriptor | scd | Provides the GridSummaryColumnDescriptor. |
Returns
Type | Description |
---|---|
System.String | The summary formatted text as specified with GridSummaryColumnDescriptor.Format |
GetSummaryText(String, String)
Returns the formatted summary text for the given group, summary row and column.
Declaration
public string GetSummaryText(string summaryRowName, string summaryColumnName)
Parameters
Type | Name | Description |
---|---|---|
System.String | summaryRowName | The name of the GridSummaryRowDescriptor in the SummaryRows collection. |
System.String | summaryColumnName | The name of the GridSummaryColumnDescriptor in the GridSummaryRowDescriptor.Summaries collection. |
Returns
Type | Description |
---|---|
System.String | The summary formatted text as specified with Format |
Remarks
See GridSummaryColumnDescriptor for an example.
See Also
IsChildVisible(Element)
Determines whether the child of the given element is visible.
Declaration
public override bool IsChildVisible(Element el)
Parameters
Type | Name | Description |
---|---|---|
Element | el | The element. |
Returns
Type | Description |
---|---|
System.Boolean | True if it is visible. |
Overrides
IsGroupVisible()
Determines whether this group should be visible. By default a group is hidden if it does not have any records that meet filter criteria.
Declaration
protected override bool IsGroupVisible()
Returns
Type | Description |
---|---|
System.Boolean | true if group should be visible; false otherwise. |
Overrides
OnEnsureInitialized(Object)
This virtual method is called from OnEnsureInitialized(Object) and lets derived elements implement element-specific logic to ensure object is up to data.
Declaration
protected override bool OnEnsureInitialized(object sender)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The object that triggered the EnsureInitialized(Object) call. |
Returns
Type | Description |
---|---|
System.Boolean | True if changes were detected and the object was updated; False otherwise. |
Overrides
OnInitializeSections(Boolean, SortColumnDescriptorCollection)
Declaration
protected override void OnInitializeSections(bool hasRecords, SortColumnDescriptorCollection fields)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | hasRecords | |
SortColumnDescriptorCollection | fields |
Overrides
OnInitializeVisibleCounters()
Declaration
protected override void OnInitializeVisibleCounters()
Overrides
ResetAppearance()
Discards any changes for the Appearance object.
Declaration
public void ResetAppearance()
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. |
ShouldShowCaption()
Determines whether the caption row should be shown
Declaration
public override bool ShouldShowCaption()
Returns
Type | Description |
---|---|
System.Boolean | True if it is made visible. |
Overrides
Explicit Interface Implementations
IGridGroupOptionsSource.GetParentGroupOptionsSource()
Declaration
IGridGroupOptionsSource IGridGroupOptionsSource.GetParentGroupOptionsSource()
Returns
Type |
---|
IGridGroupOptionsSource |
IGridGroupOptionsSource.RaiseGroupOptionsChanged(GridGroupOptionsChangedEventArgs)
Declaration
void IGridGroupOptionsSource.RaiseGroupOptionsChanged(GridGroupOptionsChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridGroupOptionsChangedEventArgs | e |
IGridGroupOptionsSource.RaiseGroupOptionsChanging(GridGroupOptionsChangedEventArgs)
Declaration
void IGridGroupOptionsSource.RaiseGroupOptionsChanging(GridGroupOptionsChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridGroupOptionsChangedEventArgs | e |
IGridTableCellAppearanceSource.GetAppearance()
Declaration
GridTableCellAppearance IGridTableCellAppearanceSource.GetAppearance()
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 |