menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridGroup - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    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.

    Inheritance
    System.Object
    Element
    Group
    GridGroup
    Implements
    System.IDisposable
    ITreeTableCounterSource
    ITreeTableSummaryArraySource
    IGridTableCellAppearanceSource
    IGridGroupOptionsSource
    Inherited Members
    Element.ChildTableGroupLevel
    Element.Dispose()
    Element.Disposed
    Element.Disposing
    Element.EnsureInitialized(Object)
    Element.EnsureInitialized(Object, Boolean)
    Element.GetCaptionSection()
    Element.GetCaptionSection(Element)
    Element.GetColumnHeaderSection()
    Element.GetColumnHeaderSection(Element)
    Element.GetCounter()
    Element.GetCustomPosition()
    Element.GetData()
    Element.GetFilterBar()
    Element.GetFilterBar(Element)
    Element.GetRecord()
    Element.GetRecord(Element)
    Element.GetSummaries(Table)
    Element.GetVisibleCustomPosition()
    Element.GetVisibleInHierarchy()
    Element.GetVisibleInParent()
    Element.GroupLevel
    Element.InDisposed
    Element.Info
    Element.IsCaption()
    Element.IsCaption(Element)
    Element.IsColumnHeader()
    Element.IsColumnHeader(Element)
    Element.IsDisposed
    Element.IsFilterBar()
    Element.IsFilterBar(Element)
    Element.IsRecord()
    Element.IsRecord(Element)
    Element.ITreeTableSummaryArraySource.GetSummaries(ITreeTableEmptySummaryArraySource, Boolean)
    Element.Kind
    Element.OnBeginEditCalled()
    Element.OnBeginEditComplete(Boolean)
    Element.OnCancelEditCalled()
    Element.OnCancelEditComplete(Boolean)
    Element.OnDisposed(EventArgs)
    Element.OnElementTreeInvalidateCounterBottomUp()
    Element.OnEndEditCalled()
    Element.OnEndEditComplete(Boolean)
    Element.OnEnterRecordCalled()
    Element.OnEnterRecordComplete(Boolean)
    Element.OnLeaveRecordCalled()
    Element.OnLeaveRecordComplete(Boolean)
    Element.ParentDisplayElement
    Element.ParentElement
    Element.ParentGroup
    Element.ParentSection
    Element.Reserved1
    Element.Reserved10
    Element.Reserved11
    Element.Reserved16a
    Element.Reserved16b
    Element.Reserved16c
    Element.Reserved2
    Element.Reserved3
    Element.Reserved4
    Element.Reserved5
    Element.Reserved6
    Element.Reserved7
    Element.Reserved8
    Element.Reserved9
    Element.TableLevel
    Group.BeginInit()
    Group.CachedVisibleCount
    Group.CachedVisibleCustomCount
    Group.CachedVisibleItemCount
    Group.CachedYamountCount
    Group.Caption
    Group.CategoriesToString()
    Group.Category
    Group.CategoryColumns
    Group.CategoryForeignKeyParentIds
    Group.CategoryKeys
    Group.CollapseAllGroups()
    Group.CollapseAllGroups(Boolean)
    Group.CollapseAllRecords()
    Group.CollapseAllRecords(Boolean)
    Group.Details
    Group.EndInit()
    Group.ExpandAllGroups()
    Group.ExpandAllGroups(Boolean)
    Group.ExpandAllGroups(Boolean, Boolean)
    Group.ExpandAllRecords(Boolean)
    Group.ExpandAllRecords(Boolean, Boolean)
    Group.FilteredChildNodeCount
    Group.FilteredRecords
    Group.FindAddNewRecord()
    Group.FlattenedFilteredRecords
    Group.FlattenedRecords
    Group.GetChildCount()
    Group.GetChildListPosition()
    Group.GetCustomCount()
    Group.GetDefaultValue(FieldDescriptor)
    Group.GetElementCount()
    Group.GetFilteredRecordCount()
    Group.GetFirstRecord()
    Group.GetFormattedSummaryProperty(String, String, String)
    Group.GetFormattedSummaryProperty(SummaryDescriptor, String, String)
    Group.GetRecordCount()
    Group.GetSummaries(Table, Boolean)
    Group.GetSummary(Int32)
    Group.GetSummary(String)
    Group.GetSummary(SummaryDescriptor)
    Group.GetSummaryProperty(String, String)
    Group.GetSummaryProperty(SummaryDescriptor, String)
    Group.GetVisibleCount()
    Group.GetVisibleCustomCount()
    Group.GetYAmountCount()
    Group.Groups
    Group.GroupTypedListRecords
    Group.Id
    Group.InitializeDetails(Boolean, SortColumnDescriptorCollection, Boolean)
    Group.InvalidateCounter()
    Group.InvalidateCounterBottomUp()
    Group.InvalidateCounterTopDown(Boolean)
    Group.InvalidateSummariesBottomUp()
    Group.InvalidateSummariesTopDown()
    Group.InvalidateSummary()
    Group.IsExpanded
    Group.IsMainGroup
    Group.IsTopLevelGroup
    Group.Name
    Group.OldCaptionText
    Group.PassThroughItem
    Group.Records
    Group.Sections
    Group.SetChildListPosition(Int32)
    Group.SetExpanded(Boolean, Boolean, Boolean)
    Group.SourceList
    Group.Summary
    Group.SupportsId()
    Group.ToString()
    Group.UniqueGroupId
    Group.UniqueGroupIdsToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    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
    Group.IsCollapsible

    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
    Group.CreateGroupTypedListRecordsCollection()

    Dispose(Boolean)

    Release the unmanaged resources.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    Group.Dispose(Boolean)

    GetBaseAppearance()

    Gets a GridTableCellAppearance of the first parent element with appearance in the hierarchy.

    Declaration
    public GridTableCellAppearance GetBaseAppearance()
    Returns
    Type Description
    GridTableCellAppearance

    A 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
    GridEngine

    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
    Group.IsChildVisible(Element)

    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
    Group.IsGroupVisible()

    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
    Element.OnEnsureInitialized(Object)

    OnInitializeSections(Boolean, SortColumnDescriptorCollection)

    Declaration
    protected override void OnInitializeSections(bool hasRecords, SortColumnDescriptorCollection fields)
    Parameters
    Type Name Description
    System.Boolean hasRecords
    SortColumnDescriptorCollection fields
    Overrides
    Group.OnInitializeSections(Boolean, SortColumnDescriptorCollection)

    OnInitializeVisibleCounters()

    Declaration
    protected override void OnInitializeVisibleCounters()
    Overrides
    Group.OnInitializeVisibleCounters()

    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
    Group.ShouldShowCaption()

    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

    Implements

    System.IDisposable
    ITreeTableCounterSource
    ITreeTableSummaryArraySource
    IGridTableCellAppearanceSource
    IGridGroupOptionsSource
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved