Class GridRecord
Represents a record with data. Each record in the datasource has an associated Record object in the engine. Records are created when the datasource is assigned to a table and before they are sorted or filtered. Also when a new record is inserted in the datasource, a Record is created. When the grouping or sorting of a Table changes, all Record elements stay in sync with their underlying record-counterparts in the datasource.
By default a record will not appear in the DisplayElements. Instead a record serves as a container of multiple row elements and nested tables.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid.Grouping
Assembly: Syncfusion.Grid.Grouping.Windows.dll
Syntax
public class GridRecord : Record, IDisposable, IDisposedEvent, IIsDisposedProperty, ITreeTableCounterSource, ITreeTableSummaryArraySource, IContainerElement, IElementTreeTableSource, IElement, IComparable, ICloneable, IGridTableCellAppearanceSource, IGridTableCellStyleChanged
Remarks
There are multiple ways to get access to a specific record:
- The UnsortedRecords collection of the Table class provides access to the records in the same order as they appear in the datasource. The IndexOf(Record) method of an UnsortedRecordsCollection determines the index of any record in the underlying datasource.
- The Records collection of the Table class provides access to the records in the order as they were sorted in the engine. The IndexOf(Record) method of a RecordsInTableCollection determines the index of any record in the Table.Records collection.
- The FilteredRecords collection of the Table class provides access to records that meet filter criteria in the order as they were sorted in the engine. The IndexOf(Record) method of a RecordsInTableCollection determines the index of any record in the Table.FilteredRecords collection.
- The Records collection of the Group class provides access to the records in the order as they appear in the group. The RecordsInDetailsCollection method of a RecordsInDetailsCollection determines the index of any record in the Group.Records collection.
- The FilteredRecords collection of the Group class provides access to the records in the order as they appear in the group. The IndexOf(Record) method of a FilteredRecordsInDetailsCollection determines the index of any record in the Group.FilteredRecords collection.
Given a RecordRow or NestedTable, you can query its ParentRecord property to determine which record these elements belong to.
Since record elements always stay in sync with their underlying record-counterparts in the datasource, you can keep a bookmark (reference) to a record. For example you can save a reference to a record, change the sort order of the table, and then later check Records.IndexOf to determine the new position where the record can be located after the sort.
By default, a record will not appear in the DisplayElements. Instead a record serves as a container for multiple row elements and nested tables. One exception is if you specified RecordAsDisplayElements. You can set RecordAsDisplayElements to True if you do not want the engine to treat record and ColumnHeaderSection elements as ContainerElements and instead have these elements be returned as a display element in the Table.DisplayElements collection. However, with a GridGroupingControl you must not change this property since a GridGroupingControl relies on the behavior that a record is not a display element but a container for rows and nested tables.
The GetData() method will return a reference to the original record with data in the datasource.
A record can be navigated to a current record if you call its Record method.
Individual field contents can be retrieved with its Record method.
Constructors
GridRecord(Table)
Initializes a new instance of the GridRecord class.
Declaration
public GridRecord(Table parent)
Parameters
Type | Name | Description |
---|---|---|
Table | parent | The table this record 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 |
IsCollapsible
Gets whether this element is collapsible.
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 |
ReadOnlyAppearance
Gets the object's 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 |
Methods
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
GetBaseAppearance()
Returns a GridTableCellAppearance of the first parent element with appearance in the hierarchy.
Declaration
public GridTableCellAppearance GetBaseAppearance()
Returns
Type | Description |
---|---|
GridTableCellAppearance |
GetValue(FieldDescriptor)
Overridden to get the display member value for filtering a column.
Declaration
public override object GetValue(FieldDescriptor fieldDescriptor)
Parameters
Type | Name | Description |
---|---|---|
FieldDescriptor | fieldDescriptor | The field to be retrieved. |
Returns
Type | Description |
---|---|
System.Object | The display member value if it is having the display member. otherwise returns the value member. |
Overrides
GetValue(SortColumnDescriptor)
Gets the value of the record.
Declaration
public override object GetValue(SortColumnDescriptor cd)
Parameters
Type | Name | Description |
---|---|---|
SortColumnDescriptor | cd | The field to be retrieved. |
Returns
Type | Description |
---|---|
System.Object | Record value. |
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. |
ShouldShowRecordPreviewRows()
Determines whether the record preview rows should be made visible.
Declaration
public override bool ShouldShowRecordPreviewRows()
Returns
Type | Description |
---|---|
System.Boolean | True if they are visible. |
Overrides
ShouldShowRecordRows()
Determines whether the record rows should be visible.
Declaration
public override bool ShouldShowRecordRows()
Returns
Type | Description |
---|---|
System.Boolean | True if they are visible. |
Overrides
Explicit Interface Implementations
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 |
IGridTableCellStyleChanged.RaiseTableCellStyleChanged(GridTableCellStyleInfoEventArgs)
Declaration
void IGridTableCellStyleChanged.RaiseTableCellStyleChanged(GridTableCellStyleInfoEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
GridTableCellStyleInfoEventArgs | e |