Class CaptionSection
Defines and implements the class that supports the section of the Caption row.
Implements
Inherited Members
Namespace: Syncfusion.Grouping
Assembly: Syncfusion.Grouping.Base.dll
Syntax
public class CaptionSection : RowElementsSection, IDisposable, IDisposedEvent, IIsDisposedProperty, ITreeTableCounterSource, ITreeTableSummaryArraySource, IRowElementsContainer, IContainerElement, IElementTreeTableSource, IElement
Remarks
This is the first section within a group which provides the caption bar above the column headers. CaptionSection is a display element and will be an item returned by the Table.DisplayElements and Table.GroupedElements collection.
CaptionSection is also a section that can be accessed through the Group.Sections collection of its parent group.
If a caption should be displayed at the beginning of each group, then CaptionSection (s) are created when the grouping for a table is initialized. The grouping engine loops through all sorted records and categorizes them. For each new group, the virtual TableDescriptor.CreateGroup factory method is called. The TableDescriptor.CreateGroup method instantiates a CaptionSection by calling the virtual TableDescriptor.CreateCaptionSection factory method.
Examples
The following example creates a string based on the CaptionSection's parent Group number of direct child elements (as usually shown in the caption element for a group in GroupingGrid). Use the ParentGroup property to get access to the parent Group of this CaptionSection:
CaptionSection cs;
object cat = cs.ParentGroup.Category;
if (cat == null)
cat = "(null)";
string caption = "{2} Item(s)";
string groupName = cs.ParentGroup.Name;
if (groupName != "")
caption = "{0}: {1} - " + caption;
return string.Format(caption, groupName, cat, cs.ParentGroup.GetChildCount());
See also:
TableDescriptor.CreateGroup, TableDescriptor.CreateCaptionSection, Group.Caption, Group.Sections, IDisplayElement
Constructors
CaptionSection(Group)
Initializes a new instance of the CaptionSection class in the specified group.
Declaration
public CaptionSection(Group parent)
Parameters
Type | Name | Description |
---|---|---|
Group | parent | The group this section is created in. |
Properties
CaptionRows
Gets the value of collection of CaptionRow elements.
Declaration
public CaptionRowCollection CaptionRows { get; }
Property Value
Type |
---|
CaptionRowCollection |
Id
Gets or sets the value of the Id used to lookup objects.
Declaration
public override int Id { get; set; }
Property Value
Type |
---|
System.Int32 |
Overrides
Remarks
Used by internal caches.
Kind
Override and gets value of the display element Kind.
Declaration
public override DisplayElementKind Kind { get; }
Property Value
Type |
---|
DisplayElementKind |
Overrides
Methods
Dispose(Boolean)
Overrides and manages the unwanted resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
GetElementCount()
Overrides and gets the number of elements.
Declaration
public override int GetElementCount()
Returns
Type | Description |
---|---|
System.Int32 | Element count. |
Overrides
GetFilteredRecordCount()
Overrides and gets the number of filtered records.
Declaration
public override int GetFilteredRecordCount()
Returns
Type | Description |
---|---|
System.Int32 | Filtered record count. |
Overrides
GetRecordCount()
Overrides and gets the number of records.
Declaration
public override int GetRecordCount()
Returns
Type | Description |
---|---|
System.Int32 | Record count. |
Overrides
GetVisibleCount()
Overrides and gets the number of visible elements.
Declaration
public override int GetVisibleCount()
Returns
Type | Description |
---|---|
System.Int32 | Visible element count. |
Overrides
GetYAmountCount()
Overrides and gets the height of the caption.
Declaration
public override double GetYAmountCount()
Returns
Type | Description |
---|---|
System.Double | Caption height. |
Overrides
SupportsId()
Overrides and determines if this object can be uniquely identified using its Id or not.
Declaration
public override bool SupportsId()
Returns
Type | Description |
---|---|
System.Boolean | True |