WinForms

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Element

    Show / Hide Table of Contents

    Class Element

    Represents the base class for all elements in the grouping engine that represent the grouped structure of an underlying data source.

    Inheritance
    System.Object
    Element
    Group
    NestedTable
    Record
    RecordPart
    RowElement
    Section
    Table
    Implements
    System.IDisposable
    ITreeTableCounterSource
    ITreeTableSummaryArraySource
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Grouping
    Assembly: Syncfusion.Grouping.Base.dll
    Syntax
    public abstract class Element : IDisposable, IDisposedEvent, IIsDisposedProperty, ITreeTableCounterSource, ITreeTableSummaryArraySource

    Constructors

    Element()

    Initializes a new instance of the Element class.

    Declaration
    protected Element()

    Element(Element)

    Initializes a new instance of the Element class.

    Declaration
    protected Element(Element parent)
    Parameters
    Type Name Description
    Element parent

    Properties

    ChildTableGroupLevel

    Gets the level for a nested child table.

    Declaration
    public int ChildTableGroupLevel { get; }
    Property Value
    Type Description
    System.Int32

    Disposing

    Gets the value indicating whether the object is in the Dispose() method or not.

    Declaration
    public bool Disposing { get; }
    Property Value
    Type Description
    System.Boolean

    True If the object is executing the Dispose() method; Otherwise False.

    Engine

    Gets the value of the Engine this element belongs to.

    Declaration
    public virtual Engine Engine { get; }
    Property Value
    Type Description
    Engine

    EngineTable

    Gets the reference to the main Table of the Engine this element belongs to.

    Declaration
    public virtual Table EngineTable { get; }
    Property Value
    Type Description
    Table

    GroupLevel

    Gets the level for a nested group.

    Declaration
    public int GroupLevel { get; }
    Property Value
    Type Description
    System.Int32

    Id

    Gets the caches use this id to look up objects.

    Declaration
    public virtual int Id { get; set; }
    Property Value
    Type Description
    System.Int32

    A unique integer Id.

    InDisposed

    Gets a value indicating whether the object was disposed and executing the Disposed event.

    Declaration
    public bool InDisposed { get; }
    Property Value
    Type Description
    System.Boolean

    Info

    Gets the debug text information about the element.

    Declaration
    public string Info { get; }
    Property Value
    Type Description
    System.String

    IsDisposed

    Gets a value indicating whether the object had been disposed or not.

    Declaration
    public bool IsDisposed { get; }
    Property Value
    Type Description
    System.Boolean

    Kind

    Gets the display element kind.

    Declaration
    public virtual DisplayElementKind Kind { get; }
    Property Value
    Type Description
    DisplayElementKind

    ParentChildTable

    Gets the reference to the child table this element belongs. A ChildTable is either a TopLevelGroup or a group that can be referenced as a nested table from a record in a parent table.

    Declaration
    public virtual ChildTable ParentChildTable { get; }
    Property Value
    Type Description
    ChildTable

    ParentDisplayElement

    Gets the parent this element belongs to. If this element is a ChildTable, the NestedTable that links the parent table with the child table is returned.

    Declaration
    public virtual Element ParentDisplayElement { get; }
    Property Value
    Type Description
    Element

    ParentElement

    Gets or sets the parent this element belongs to.

    Declaration
    public virtual Element ParentElement { get; set; }
    Property Value
    Type Description
    Element

    ParentGroup

    Gets the reference to the parent Group this element belongs to. If the element is a top-level group, then NULL is returned.

    Declaration
    public virtual Group ParentGroup { get; }
    Property Value
    Type Description
    Group

    ParentRecord

    Gets the reference to the parent Record this element belongs to. If the element is not a child of a record (e.g. a group), then NULL is returned.

    Declaration
    public virtual Record ParentRecord { get; }
    Property Value
    Type Description
    Record

    ParentSection

    Gets the reference to the parent Section this element belongs to.

    Declaration
    public virtual Section ParentSection { get; }
    Property Value
    Type Description
    Section

    ParentTable

    Gets a reference to the parent Table this element belongs to.

    Declaration
    public virtual Table ParentTable { get; set; }
    Property Value
    Type Description
    Table
    Exceptions
    Type Condition
    System.NotSupportedException

    Since the element is read-only, set operation is not supported and exception occurs.

    ParentTableDescriptor

    Gets the TableDescriptor of the element belongs to.

    Declaration
    public virtual TableDescriptor ParentTableDescriptor { get; }
    Property Value
    Type Description
    TableDescriptor

    Reserved1

    Declaration
    public bool Reserved1 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved10

    Declaration
    public bool Reserved10 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved11

    Declaration
    public bool Reserved11 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved16a

    Declaration
    public int Reserved16a { get; set; }
    Property Value
    Type Description
    System.Int32

    Reserved16b

    Declaration
    public int Reserved16b { get; set; }
    Property Value
    Type Description
    System.Int32

    Reserved16c

    Declaration
    public int Reserved16c { get; set; }
    Property Value
    Type Description
    System.Int32

    Reserved2

    Declaration
    public bool Reserved2 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved3

    Declaration
    public bool Reserved3 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved4

    Declaration
    public bool Reserved4 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved5

    Declaration
    public bool Reserved5 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved6

    Declaration
    public bool Reserved6 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved7

    Declaration
    public bool Reserved7 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved8

    Declaration
    public bool Reserved8 { get; set; }
    Property Value
    Type Description
    System.Boolean

    Reserved9

    Declaration
    public bool Reserved9 { get; set; }
    Property Value
    Type Description
    System.Boolean

    TableLevel

    Gets the table hierarchy level of this element.

    Declaration
    public int TableLevel { get; }
    Property Value
    Type Description
    System.Int32
    Remarks

    It is -1 for the root element. 0 for elements belonging to the main table and greater than 0 for elements that belong to nested table.

    Methods

    Dispose()

    Disposes the object.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Cleans-up the state of this object when it is disposed.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    True if called from Dispose(Boolean); False if called from Finalizer.

    EnsureInitialized(Object)

    Ensures the object and nested objects reflect any changes made to the engine or table descriptor. This is an integral part of the engine's "on-demand execution" of schema changes. Before elements in the engine are accessed, they call OnEnsureInitialized(Object). If changes were previously made that affect the queried element, all changes will be applied at this time.

    Declaration
    public bool EnsureInitialized(object sender)
    Parameters
    Type Name Description
    System.Object sender

    The object that triggered the call.

    Returns
    Type Description
    System.Boolean

    True if changes were detected and the object was updated; Otherwise False.

    EnsureInitialized(Object, Boolean)

    Ensures the object, nested objects, and parent elements reflect any changes made to the engine or table descriptor. This is an integral part of the engine's "on-demand execution" of schema changes. Before elements in the engine are accessed, they call OnEnsureInitialized(Object). If changes were previously made that affect the queried element, all changes will be applied at this time.

    Declaration
    public virtual bool EnsureInitialized(object sender, bool notifyParent)
    Parameters
    Type Name Description
    System.Object sender

    The object that triggered the call.

    System.Boolean notifyParent

    Specifies if the parent elements OnEnsureInitialized(Object) should also be called.

    Returns
    Type Description
    System.Boolean

    True if changes were detected and the object was updated; Otherwise False.

    GetCaptionSection()

    Gets the CaptionSection this element belongs to or the element itself, if it is a CaptionSection.

    Declaration
    public CaptionSection GetCaptionSection()
    Returns
    Type Description
    CaptionSection

    Caption section.

    GetCaptionSection(Element)

    Gets the CaptionSection this element belongs to or the element itself, if it is a CaptionSection.

    Declaration
    public static CaptionSection GetCaptionSection(Element el)
    Parameters
    Type Name Description
    Element el
    Returns
    Type Description
    CaptionSection

    Caption section.

    GetChildCount()

    Gets the number of direct child elements that belong to this element's collection or 0 if this is not a container element. Good for determining the number of items to be displayed in a group's "(#) Items" caption.

    Declaration
    public virtual int GetChildCount()
    Returns
    Type Description
    System.Int32

    Number of child.

    GetColumnHeaderSection()

    Gets the ColumnHeaderSection this element belongs to or the element itself, if it is a ColumnHeaderSection.

    Declaration
    public ColumnHeaderSection GetColumnHeaderSection()
    Returns
    Type Description
    ColumnHeaderSection

    Column header section.

    GetColumnHeaderSection(Element)

    Gets the ColumnHeaderSection this element belongs to or the element itself, if it is a ColumnHeaderSection.

    Declaration
    public static ColumnHeaderSection GetColumnHeaderSection(Element el)
    Parameters
    Type Name Description
    Element el
    Returns
    Type Description
    ColumnHeaderSection

    Column header section.

    GetCounter()

    Gets the counter.

    Declaration
    public virtual ITreeTableCounter GetCounter()
    Returns
    Type Description
    ITreeTableCounter

    Returns the ITreeTableCounter value.

    GetCustomCount()

    Gets the custom count for the element.

    Declaration
    public virtual double GetCustomCount()
    Returns
    Type Description
    System.Double

    Returns 0.

    GetCustomPosition()

    Gets the position for the Custom Counter of this element.

    Declaration
    public double GetCustomPosition()
    Returns
    Type Description
    System.Double

    The custom counter position for this element.

    Remarks

    See the "Grid.Grouping\Samples\CustomSummaries" sample for example usage of custom counters.

    GetData()

    Gets the data of the given record from the data source.

    Declaration
    public virtual object GetData()
    Returns
    Type Description
    System.Object

    A reference to the underlying data for the record.

    Remarks

    If the element is a record, GetData returns a reference to the underlying data for the record, e.g. the DataRowView of a DataView.

    GetElementCount()

    Gets the number of visible elements in this group.

    Declaration
    public abstract int GetElementCount()
    Returns
    Type Description
    System.Int32

    Element count.

    GetFilterBar()

    Gets the FilterBarSection this element belongs to or the element itself, if it is a FilterBarSection.

    Declaration
    public FilterBarSection GetFilterBar()
    Returns
    Type Description
    FilterBarSection

    Returns FilterBarSection.

    GetFilterBar(Element)

    Gets the FilterBarSection this element belongs to or the element itself, if it is a FilterBarSection.

    Declaration
    public static FilterBarSection GetFilterBar(Element el)
    Parameters
    Type Name Description
    Element el
    Returns
    Type Description
    FilterBarSection

    Returns FilterBarSection

    GetFilteredRecordCount()

    Gets the number of visible records (excluding records that do not meet filter criteria).

    Declaration
    public abstract int GetFilteredRecordCount()
    Returns
    Type Description
    System.Int32

    Filtered record count.

    GetRecord()

    Gets the Record this element belongs to or the element itself, if it is a Record.

    Declaration
    public Record GetRecord()
    Returns
    Type Description
    Record

    Returns Record.

    GetRecord(Element)

    Gets the Record this element belongs to or the element itself, if it is a Record.

    Declaration
    public static Record GetRecord(Element el)
    Parameters
    Type Name Description
    Element el
    Returns
    Type Description
    Record

    Returns Record.

    GetRecordCount()

    Gets the number of visible elements (0 for captions, groups etc. 1 for records).

    Declaration
    public abstract int GetRecordCount()
    Returns
    Type Description
    System.Int32

    Record count.

    GetSummaries(Table)

    Gets summary information for this element and child elements. The summaries are in the same order as the Summaries of the parent table descriptor.

    Declaration
    public ITreeTableSummary[] GetSummaries(Table parentTable)
    Parameters
    Type Name Description
    Table parentTable

    A reference to the parent table of this element.

    Returns
    Type Description
    ITreeTableSummary[]

    An array of ITreeTableSummary objects.

    GetSummaries(Table, out Boolean)

    Gets the summary information for this element and child elements. The summaries are in the same order as the Summaries of the parent table descriptor.

    Declaration
    public virtual ITreeTableSummary[] GetSummaries(Table parentTable, out bool summaryChanged)
    Parameters
    Type Name Description
    Table parentTable

    A reference to the parent table of this element.

    System.Boolean summaryChanged

    Returns True if changes were detected.

    Returns
    Type Description
    ITreeTableSummary[]

    An array of ITreeTableSummary objects.

    GetVisibleCount()

    Gets the number of visible elements in this group. Do not check parent's visible state when doing returning FilterCount in display elements. Only container elements behave different. They will ignore values returned form CounterTreeTable.

    Declaration
    public abstract int GetVisibleCount()
    Returns
    Type Description
    System.Int32

    Number of visible elements.

    GetVisibleCustomCount()

    Gets the custom count for visible elements.

    Declaration
    public virtual double GetVisibleCustomCount()
    Returns
    Type Description
    System.Double

    Returns 0.

    GetVisibleCustomPosition()

    Gets the position for the Visible Custom Counter of this element.

    Declaration
    public double GetVisibleCustomPosition()
    Returns
    Type Description
    System.Double

    The visible custom counter position for this element.

    Remarks

    See the "Grid.Grouping\Samples\CustomSummaries" sample for example usage of custom counters.

    GetVisibleInHierarchy()

    Determines whether the given element is visible and if all of its parents are also visible or not.

    Declaration
    public bool GetVisibleInHierarchy()
    Returns
    Type Description
    System.Boolean

    True if the element and all its parent elements are visible; Otherwise False.

    Remarks

    If this element belongs to a parent group that has been collapsed, it will return False.

    GetVisibleInParent()

    Determines whether this element is visible in the parent element it belongs to as returned by IsChildVisible(Element) of the parent element or not.

    Declaration
    public bool GetVisibleInParent()
    Returns
    Type Description
    System.Boolean

    True if element is visible; Otherwise False.

    GetYAmountCount()

    Gets the height (e.g. screen pixels) for the element.

    Declaration
    public abstract double GetYAmountCount()
    Returns
    Type Description
    System.Double

    Element height.

    InvalidateCounter()

    Resets the counter for all the elements.

    Declaration
    public virtual void InvalidateCounter()

    InvalidateCounterBottomUp()

    Resets the counter for all elements from bottom to top.

    Declaration
    public virtual void InvalidateCounterBottomUp()

    InvalidateCounterTopDown(Boolean)

    For internal use.

    Declaration
    public abstract void InvalidateCounterTopDown(bool notifyCounterSource)
    Parameters
    Type Name Description
    System.Boolean notifyCounterSource

    InvalidateSummariesBottomUp()

    Resets the counter for all summaries from bottom to top.

    Declaration
    public virtual void InvalidateSummariesBottomUp()

    InvalidateSummariesTopDown()

    Resets the counter for all summaries from top to bottom.

    Declaration
    public abstract void InvalidateSummariesTopDown()

    InvalidateSummary()

    Resets the counter for the current summary.

    Declaration
    public abstract void InvalidateSummary()

    IsCaption()

    Determines whether the given element is a caption element or not.

    Declaration
    public bool IsCaption()
    Returns
    Type Description
    System.Boolean

    True if this is a caption; Otherwise False.

    IsCaption(Element)

    Determines whether the given element is a caption element or not.

    Declaration
    public static bool IsCaption(Element el)
    Parameters
    Type Name Description
    Element el
    Returns
    Type Description
    System.Boolean

    True if this is a caption; Otherwise False.

    IsChildVisible(Element)

    Determines if the specified element is a direct child element of this element and if it should appear in visible display elements collection or not.

    Declaration
    public virtual bool IsChildVisible(Element el)
    Parameters
    Type Name Description
    Element el

    The child element to be analyzed.

    Returns
    Type Description
    System.Boolean

    True if element is visible; Otherwise False.

    IsColumnHeader()

    Determines whether the given element is a column header element or not.

    Declaration
    public bool IsColumnHeader()
    Returns
    Type Description
    System.Boolean

    True if this is a column header; Otherwise False.

    IsColumnHeader(Element)

    Determines whether the given element is a column header element or not.

    Declaration
    public static bool IsColumnHeader(Element el)
    Parameters
    Type Name Description
    Element el
    Returns
    Type Description
    System.Boolean

    True if this is a column header; Otherwise False.

    IsFilterBar()

    Determines whether the given element is a filter-bar element or not.

    Declaration
    public bool IsFilterBar()
    Returns
    Type Description
    System.Boolean

    True if this is a filter bar; Otherwise False.

    IsFilterBar(Element)

    Determines whether the given element is a filter-bar element or not.

    Declaration
    public static bool IsFilterBar(Element el)
    Parameters
    Type Name Description
    Element el
    Returns
    Type Description
    System.Boolean

    True if this is a filter bar; Otherwise False.

    IsRecord()

    Determines whether the given element is a record element or not.

    Declaration
    public bool IsRecord()
    Returns
    Type Description
    System.Boolean

    True if this is a record; Otherwise False.

    IsRecord(Element)

    Determines whether the given element if this is a record element.

    Declaration
    public static bool IsRecord(Element el)
    Parameters
    Type Name Description
    Element el
    Returns
    Type Description
    System.Boolean

    True if this is a record; Otherwise False.

    OnBeginEditCalled()

    Determines whether the BeginEdit() method is called or not.

    Declaration
    public virtual bool OnBeginEditCalled()
    Returns
    Type Description
    System.Boolean

    True if BeginEdit() can proceed; Otherwise False. and it gets aborted.

    OnBeginEditComplete(Boolean)

    Occurs when the BeginEdit() method successfully finishes.

    Declaration
    public virtual void OnBeginEditComplete(bool success)
    Parameters
    Type Name Description
    System.Boolean success

    True, if it successfully finished; Otherwise False.

    OnCancelEditCalled()

    Determines whether the CancelEdit() method is called or not.

    Declaration
    public virtual bool OnCancelEditCalled()
    Returns
    Type Description
    System.Boolean

    True if CancelEdit() can proceed; Otherwise False and it gets aborted.

    OnCancelEditComplete(Boolean)

    Occurs when the CancelEdit() method successfully finishes.

    Declaration
    public virtual void OnCancelEditComplete(bool success)
    Parameters
    Type Name Description
    System.Boolean success

    True if it is successfully finished; Otherwise False.

    OnDisposed(EventArgs)

    Raises the Disposed event.

    Declaration
    protected virtual void OnDisposed(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    An System.EventArgs contains the event data.

    OnElementTreeInvalidateCounterBottomUp()

    Resets the counter for all element- tree entries from bottom to top.

    Declaration
    public virtual void OnElementTreeInvalidateCounterBottomUp()

    OnEndEditCalled()

    Determines whether the EndEdit() method is called or not.

    Declaration
    public virtual bool OnEndEditCalled()
    Returns
    Type Description
    System.Boolean

    True if EndEdit() can proceed; Otherwise False and it gets aborted.

    OnEndEditComplete(Boolean)

    Occurs when the EndEdit() method successfully finishes.

    Declaration
    public virtual void OnEndEditComplete(bool success)
    Parameters
    Type Name Description
    System.Boolean success

    True, if it is successfully finished; Otherwise False.

    OnEnsureInitialized(Object)

    Determines whether the virtual method is called from OnEnsureInitialized(Object) and lets derived elements implement element-specific logic to ensure object is updated or not.

    Declaration
    protected virtual bool OnEnsureInitialized(object sender)
    Parameters
    Type Name Description
    System.Object sender

    The object that triggered the OnEnsureInitialized(Object) call.

    Returns
    Type Description
    System.Boolean

    True if changes were detected and the object was updated; Otherwise False.

    OnEnterRecordCalled()

    Determines whether the EnterRecord(Element) method is called or not.

    Declaration
    public virtual bool OnEnterRecordCalled()
    Returns
    Type Description
    System.Boolean

    True if EnterRecord(Element) can proceed; Otherwise False and it gets aborted.

    OnEnterRecordComplete(Boolean)

    Occurs when the EnterRecord(Element) method successfully finishes.

    Declaration
    public virtual void OnEnterRecordComplete(bool success)
    Parameters
    Type Name Description
    System.Boolean success

    Trueif it is successfully finished; Otherwise False.

    OnLeaveRecordCalled()

    Determines whether the LeaveRecord(Boolean) method is called or not.

    Declaration
    public virtual bool OnLeaveRecordCalled()
    Returns
    Type Description
    System.Boolean

    True if LeaveRecord(Boolean) can proceed; Otherwise False and it gets aborted.

    OnLeaveRecordComplete(Boolean)

    Occurs when the LeaveRecord(Boolean) method successfully finishes.

    Declaration
    public virtual void OnLeaveRecordComplete(bool success)
    Parameters
    Type Name Description
    System.Boolean success

    True, if it is successfully finished; Otherwise False.

    SupportsId()

    Gets a value indicating whether this object can be uniquely identified with the Id property or not. Internal caches use this id to look up objects.

    Declaration
    public virtual bool SupportsId()
    Returns
    Type Description
    System.Boolean

    True if Id property returns a unique identifier; Otherwise False.

    ToString()

    Overrides and gets a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    String representation of the current object.

    Overrides
    System.Object.ToString()

    Events

    Disposed

    Handles after the object is in disposed event.

    Declaration
    public event EventHandler Disposed
    Event Type
    Type Description
    System.EventHandler

    Explicit Interface Implementations

    ITreeTableSummaryArraySource.GetSummaries(ITreeTableEmptySummaryArraySource, out Boolean)

    Gets the summary of the element.

    Declaration
    ITreeTableSummary[] ITreeTableSummaryArraySource.GetSummaries(ITreeTableEmptySummaryArraySource emptySummaries, out bool summaryChanged)
    Parameters
    Type Name Description
    ITreeTableEmptySummaryArraySource emptySummaries

    Array of summary objects.

    System.Boolean summaryChanged

    Changed summary.

    Returns
    Type Description
    ITreeTableSummary[]

    The summary.

    Implements

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