Class GridTableDescriptor
Maintains schema information for a table. Collections define columns, column sets, fields, expressions, sorted, grouped columns, and related tables.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid.Grouping
Assembly: Syncfusion.Grid.Grouping.Windows.dll
Syntax
public class GridTableDescriptor : TableDescriptor, ICustomTypeDescriptor, IDisposable, IItemPropertiesSource, ITypedList, ITableEventsTarget, IGridTableCellAppearanceSource, IGridGroupOptionsSource, IGridTableOptionsSource, IStandardValuesProvider
Examples
The columns collections feature auto-populating on demand and reflect changes from the collection they depend on. The auto-population will happen when you access the contents of the collection, e.g. if you query its Count.
GridTableDescriptor orderDetailsTableDescriptor;
// Lets check the count of each collection:
Trace.WriteLine(orderDetailsTableDescriptor.Fields.Count); // returns 4
Trace.WriteLine(orderDetailsTableDescriptor.ExpressionFields.Count); // returns 0
Trace.WriteLine(orderDetailsTableDescriptor.Columns.Count); // returns 4 - will hold a column descriptor for each field in the fields collection
// Now, add a Expression Field.
ExpressionFieldDescriptor ed = new ExpressionFieldDescriptor("Total", "Total", typeof(double), "[UnitPrice]*[Quantity]");
ed.DefaultValue = string.Empty;
orderDetailsTableDescriptor.ExpressionFields.Add(ed);
// Lets check again the count of each collection:
Trace.WriteLine(orderDetailsTableDescriptor.Fields.Count); // returns 4
Trace.WriteLine(orderDetailsTableDescriptor.ExpressionFields.Count); // returns 1
Trace.WriteLine(orderDetailsTableDescriptor.Columns.Count); // returns 5 - will hold a column descriptor for each field in the fields collection and also a columndescriptor that references the expression field we just added.
Of course, you can also manually initialize the Columns collection. Once you modify a collection, it will not be auto re-initialized anymore.
The following example shows how to add columns that should be displayed in the grid and initializes the width of one column:
GridTableDescriptor categoriesTableDescriptor = (GridTableDescriptor) engine.TableDescriptor;
categoriesTableDescriptor.Columns.Add("CategoryID");
categoriesTableDescriptor.Columns.Add("CategoryName");
categoriesTableDescriptor.Columns.Add("Description");
categoriesTableDescriptor.Columns["CategoryName"].Width = 200;
Now that the Columns collection has been initialized manually, changes in the underlying Fields or ExpressionFields collection will not be reflected. If you now add an ExpressionField to the ExpressionFields collection, you will also need to manually add it to the Columns collection in order to display it in the grid. Suppose you added a "Total" expression to the ExpressionFields collection. You can now add this expression field to the columns collection with:
categoriesTableDescriptor.Columns.Add("Total");
Only then new expression fields will be displayed.
If you want to force re-initialization of a modified collection, you can call the ColumnDescriptorCollection.Reset() method. Once you call Columns.Reset, the columns collection will again auto-populate all fields from the Fields and ExpressionFields collections.
The grid also supports displaying multiple rows per record.
The ColumnSet collection lets you specify a multi-row per record layout in a table. A ColumnSetDescriptor holds one or multiple ColumnSpans. In a GridColumnSpan, you can specify layout information of a column. You ca,n for example, specify that the Address column should be displayed in the grid above City and Region and span these two columns:
GridColumnSpanDescriptor csd1 = new GridColumnSpanDescriptor("Address");
csd1.Range = GridRangeInfo.Cells(0,0,0,1);
GridColumnSpanDescriptor csd2 = new GridColumnSpanDescriptor("City");
csd2.Range = GridRangeInfo.Cells(1,0,1,0);
GridColumnSpanDescriptor csd3 = new GridColumnSpanDescriptor("Region");
csd3.Range = GridRangeInfo.Cells(1,1,1,1);
GridColumnSetDescriptor csd = new GridColumnSetDescriptor("Address_Set");
csd.ColumnSpans.Add(csd1);
csd.ColumnSpans.Add(csd2);
csd.ColumnSpans.Add(csd3);
this.groupingGrid1.TableDescriptor.ColumnSets.Add(csd);
You can also manually initialize the VisibleColumns collection. The name of the GridColumnSetDescriptor identifies the column set descriptor or column in the VisibleColumns collection:
this.groupingGrid1.TableDescriptor.VisibleColumns.Add("Address_Set");
this.groupingGrid1.TableDescriptor.VisibleColumns.Add("Phone");
this.groupingGrid1.TableDescriptor.VisibleColumns.Add("Fax");
A GridVisibleColumnDescriptor only has a Name property. The Name property identifies a ColumnSet or Column with the same name.
Constructors
GridTableDescriptor()
Initializes a new instance of the GridTableDescriptor class.
Declaration
public GridTableDescriptor()
GridTableDescriptor(RelationDescriptor)
Initializes a new GridTableDescriptor class with the specified instance of the RelationDescriptor class.
Declaration
public GridTableDescriptor(RelationDescriptor parentRelation)
Parameters
| Type | Name | Description |
|---|---|---|
| RelationDescriptor | parentRelation | Parent relation. |
GridTableDescriptor(GridEngine, RelationDescriptor)
Initializes a new GridTableDescriptor class with the specified instance of the RelationDescriptor and GridEngine classes.
Declaration
public GridTableDescriptor(GridEngine engine, RelationDescriptor parentRelation)
Parameters
| Type | Name | Description |
|---|---|---|
| GridEngine | engine | The grouping engine. |
| RelationDescriptor | parentRelation | The related child tables of the grouping grid. |
Properties
AllowCalculateMaxColumnWidth
Gets or sets whether the maximum number of characters found in record field cells should be calculated for columns. See also TableOptions.ColumnsMaxLengthStrategy.
Declaration
public bool AllowCalculateMaxColumnWidth { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Appearance
Gets or sets the default GridTableCellAppearance with default GridTableCellStyleInfo information for all cell elements in the table. This property lets you control almost every aspect of the appearance of the grouping grid like cell back color, font, or the cell type.
Declaration
public GridTableCellAppearance Appearance { get; set; }
Property Value
| Type |
|---|
| GridTableCellAppearance |
ChildGroupOptions
Gets or sets the look of inner groups like whether the Caption Row is visible or what CaptionText is.
Declaration
public GridGroupOptionsStyleInfo ChildGroupOptions { get; set; }
Property Value
| Type |
|---|
| GridGroupOptionsStyleInfo |
Columns
Gets a collection of GridColumnDescriptor columns with mapping information to columns of the underlying datasource.
Declaration
public GridColumnDescriptorCollection Columns { get; set; }
Property Value
| Type |
|---|
| GridColumnDescriptorCollection |
Remarks
When you assign a GridColumnDescriptorCollection object using this property, the existing collection object is not replaced. Instead, all properties and elements are copied from the assigned GridColumnDescriptorCollection object using the InitializeFrom(GridColumnDescriptorCollection) method.
The Columns collection lets you specify the fields that should be displayed in the GridTableControl. By default, the Columns collection is auto-populated from the underlying Fields, ExpressionFields and UnboundFields collections and will be a combination of these three collections. When the Columns collection is auto-populated and you make changes to the above collections, the changes will automatically be reflected in this collection.
GridColumnDescriptors in the Columns collection have a reference to a FieldDescriptor (or ExpressionFieldDescriptor).
Additionally, GridColumnDescriptors contain grid-specific information about a column such as the column width. You can manually set the column width or have it be automatically initialized by the grid to fit the string with the maximum length in the column's data. GridColumnDescriptor also has an Appearance property. This is where cell type and formatting of the column can be specified.
ColumnSets
Gets or sets a collection from GridColumnSetDescriptor with GridColumnSpanDescriptor information about columns that can spread multiple grid rows or columns.
Declaration
public GridColumnSetDescriptorCollection ColumnSets { get; set; }
Property Value
| Type |
|---|
| GridColumnSetDescriptorCollection |
Remarks
When you assign a GridColumnSetDescriptorCollection object using this property, the existing collection object is not replaced. Instead, all properties and elements are copied from the assigned GridColumnSetDescriptorCollection object using the InitializeFrom(GridColumnSetDescriptorCollection) method.
The ColumnSet collection lets you specify a multi-row per record layout in a table. A ColumnSetDescriptor holds one or multiple ColumnSpans. In a GridColumnSpan, you can specify layout information of a column. You can, for example, specify that the Address column should be displayed in the grid above City and Region and span these two columns.
ConditionalFormats
Gets or sets a collection from GridConditionalFormatDescriptor which provides filter criteria for displaying a subset of records from the underlying data source with conditional cell formatting.
Declaration
public GridConditionalFormatDescriptorCollection ConditionalFormats { get; set; }
Property Value
| Type |
|---|
| GridConditionalFormatDescriptorCollection |
Remarks
When you assign a GridConditionalFormatDescriptorCollection object using this property, the existing collection object is not replaced. Instead, all properties and elements are copied from the assigned GridConditionalFormatDescriptorCollection object using the InitializeFrom(GridConditionalFormatDescriptorCollection) method.
The ConditionalFormats collection has GridConditionalFormatDescriptor objects. The GridConditionalFormatDescriptor defines filter criteria for displaying a subset of records from the underlying datasource with conditional cell formatting.
Engine
Gets the GridEngine that this table descriptor belongs to.
Declaration
public GridEngine Engine { get; }
Property Value
| Type |
|---|
| GridEngine |
ForceEmptyColumns
Gets or sets whether the Columns collection should not be autopopulated. When you set this property true Columns.Columns will be called. When you set this property false, ResetColumns() will be called.
Declaration
public bool ForceEmptyColumns { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ForceEmptyVisibleColumns
Gets or sets whether the VisibleColumns collection should not be autopopulated. When you set this property true VisibleColumns.VisibleColumns will be called. When you set this property false, ResetVisibleColumns() will be called.
Declaration
public bool ForceEmptyVisibleColumns { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
FrozenColumn
Freeze columns. Gets or sets the name of a GridColumnDescriptor which defines the columns to prevent scrolling.
Declaration
public string FrozenColumn { get; set; }
Property Value
| Type |
|---|
| System.String |
Remarks
All columns left of the specified including the column will not be scrollable.
Note: If you set this property for a child table you have to make sure that the column is properly aligned with the frozen column of the parent table. It is not supported to have a different scroll position for a nested table. If it is not possible to correctly align the right border of the column in the child table with the right border of the frozen column of the parent table then you should leave this field blank.
HasCustomSummaryFilterBarChoices
Returns true if there are columns with .AllowFilter = true and GridFilterBarChoicesEventArgs.ShouldCreateSummaryDescriptor set to false.
Declaration
public bool HasCustomSummaryFilterBarChoices { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasSummaryFilterBarChoices
Returns true if any summaries were implicitly created for FilterBar
Declaration
public bool HasSummaryFilterBarChoices { get; }
Property Value
| Type |
|---|
| System.Boolean |
InheritAppearanceFomParent
Gets or sets whether the Appearance of the table descriptor should inherit properties of a ParentTableDescriptor if this object is the child table descriptor in a relation.
Declaration
public bool InheritAppearanceFomParent { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsExcelFilterWired
Indicates the grouping grid is wired with excel style filter. This is specifically used to apply the filter in excel sheet while exporting.
Declaration
public bool IsExcelFilterWired { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ParentRelation
Gets the GridRelationDescriptor that this table descriptor belongs to if it is a child table of a relation; returns NULL if it is the main table descriptor.
Declaration
public GridRelationDescriptor ParentRelation { get; }
Property Value
| Type |
|---|
| GridRelationDescriptor |
ParentTableDescriptor
Gets the GridTableDescriptor that the ParentRelation belongs to if this table descriptor is a child table of a relation; returns NULL if it is the main table descriptor.
Declaration
public GridTableDescriptor ParentTableDescriptor { get; }
Property Value
| Type |
|---|
| GridTableDescriptor |
PreviewRowsPerRecord
Gets the number of preview rows that should be added to each record.
Declaration
public override int PreviewRowsPerRecord { get; }
Property Value
| Type |
|---|
| System.Int32 |
Overrides
RecordRowColumns
Gets an internal array used for multiple rows per Record and Column to Field Mapping.
Declaration
public GridColumnDescriptor[, ] RecordRowColumns { get; }
Property Value
| Type |
|---|
| GridColumnDescriptor[,] |
RecordRowCoveredRanges
Gets an internal array used for multiple rows per Record and Column to Field Mapping.
Declaration
public GridRangeInfo[, ] RecordRowCoveredRanges { get; }
Property Value
| Type |
|---|
| GridRangeInfo[,] |
Relations
Gets the collection of GridRelationDescriptor objects defining relations to other tables.
Declaration
public GridRelationDescriptorCollection Relations { get; set; }
Property Value
| Type |
|---|
| GridRelationDescriptorCollection |
Remarks
The default state of this collection and child objects is auto-populated from relation descriptors found in the underlying source list for this table.
If you assign a System.Data.DataView or System.Data.DataSet to SetSourceList(IEnumerable), the Relations collection is auto-populated from System.Data.DataRelation objects found in the System.Data.DataSet.
RowsPerRecord
Gets the number of rows that should be added to each record.
Declaration
public override int RowsPerRecord { get; }
Property Value
| Type |
|---|
| System.Int32 |
Overrides
StackedHeaderRows
Gets or sets a collection of GridStackedHeaderRowDescriptor objects that declares StackedHeader rows each with one or multiple GridStackedHeaderDescriptor elements. An instance of this collection is returned by the StackedHeaderRows property of a GridTableDescriptor. StackedHeaders allow you to display headers that spread multiple columns before the regular column headers.
Declaration
public GridStackedHeaderRowDescriptorCollection StackedHeaderRows { get; set; }
Property Value
| Type |
|---|
| GridStackedHeaderRowDescriptorCollection |
Remarks
Each group in the GridTable has a GridStackedHeaderSection. The StackedHeader section has as many rows as there are GridStackedHeaderRowDescriptors. Each GridStackedHeaderRowDescriptor has a collection of GridStackedHeaderDescriptor columns. The GridStackedHeaderDescriptor defines the VisibleColumns or ColumnSets for which a combined header should be displayed before the normal column headers.
If you leave the VisibleColumns collection empty than this header will be used as default header for all columns that were not explicitly associated with another header.
So, if you want to just add an extra Caption then you could add a StackedHeaderRow with only one StackedHeader that has an empty VisibleColumns collection.
Summaries
Gets the collection of SummaryDescriptor objects defining summaries of the table. This collection is maintained automatically by the GridTableDescriptor and is filled with summaries from the SummaryRows collection. You should not directly modify this collection. Instead, you should modify SummaryRows.
Declaration
public SummaryDescriptorCollection Summaries { get; set; }
Property Value
| Type |
|---|
| SummaryDescriptorCollection |
Remarks
Each SummaryDescriptor in the collection references a FieldDescriptor of the Fields collection. Based on the summaries defined in this collection, each group in the table will have summaries calculated.
SummaryRows
Gets or sets a collection from GridSummaryRowDescriptor that declares summary rows each with one or multiple GridSummaryColumnDescriptor elements.
Declaration
public GridSummaryRowDescriptorCollection SummaryRows { get; set; }
Property Value
| Type |
|---|
| GridSummaryRowDescriptorCollection |
Remarks
When you assign a GridSummaryRowDescriptorCollection object using this property, the existing collection object is not replaced. Instead, all properties and elements are copied from the assigned GridSummaryRowDescriptorCollection object using the InitializeFrom(GridSummaryRowDescriptorCollection) method.
The SummaryRows collection contains GridSummaryRowDescriptors. GridSummaryRowDescriptors have a name, title, and collection of summary columns. A GridSummaryRowDescriptor also has a Read-only IsFillRow property. If this property is True, the summary should fill the whole row and not be displayed below individual columns. IsFillRow will return True if any of the GridSummaryColummDescriptors in the SummaryColumns collection is set to GridSummaryStyle.FillRow.
The GridSummaryColummDescriptor defines where to display the column in the row. Essential properties are the name, format, DisplayColumn, DataMember, and SummaryType. The multiple GridSummaryColumnDescriptor objects have a name and mapping name that identify the column for which a summary should be calculated for and a SummaryType property that defines the type of calculations to be performed.
Possible SummaryTypes are: Count, BooleanAggregate, ByteAggregate, CharAggregate, DistinctCount, DoubleAggregate, Int32Aggregate, MaxLength, StringAggregate, Vector, DoubleVector, and Custom.
When you specify the SummaryType.Custom type, you need to set the custom method through the CreateSummaryMethod property of the SummaryDescriptor. It is CreateSummaryDelegate and is called to create an instance of a summary object. You also need to handle the GridGroupingControl.QueryCustomSummary as demonstrated in the Grid/Grouping/CustomSummaries example.
SupportColumnAppearanceDeserialization
Gets or sets a value to enable/disable column appearance deserialization.
Declaration
public bool SupportColumnAppearanceDeserialization { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
TableOptions
Gets or sets the table-wide properties like the width of the indent column or whether header rows should be visible.
Declaration
public GridTableOptionsStyleInfo TableOptions { get; set; }
Property Value
| Type |
|---|
| GridTableOptionsStyleInfo |
TopLevelGroupOptions
Gets or sets the look of the top most group like whether the Caption Row is visible or what CaptionText is.
Declaration
public GridGroupOptionsStyleInfo TopLevelGroupOptions { get; set; }
Property Value
| Type |
|---|
| GridGroupOptionsStyleInfo |
VisibleColumns
Gets or sets a collection of GridVisibleColumnDescriptor columns each referencing a GridColumnDescriptor or GridColumnSetDescriptor. The order of GridVisibleColumnDescriptors in the VisibleColumns collection defines the left to right order of columns shown in the grid.
Declaration
public GridVisibleColumnDescriptorCollection VisibleColumns { get; set; }
Property Value
| Type |
|---|
| GridVisibleColumnDescriptorCollection |
Remarks
When you assign a GridVisibleColumnDescriptorCollection object using this property, the existing collection object is not replaced. Instead, all properties and elements are copied from the assigned GridVisibleColumnDescriptorCollection object using the InitializeFrom(GridVisibleColumnDescriptorCollection) method.
The VisibleColumns collection is auto-populated from the Columns collection and the ColumnSets collection. When auto-initialized, the VisibleColumns collection adds all GridColumnSetDescriptors from the ColumnSets collection and also all ColumnDescriptors from the Columns collection that have not been referenced by a ColumnSpan. So, if you do not specify any column sets, the VisibleColumns collection will have a GridVisibleColumnDescriptor for each Column with the column's name.
You can also manually initialize the VisibleColumns collection. The name of the GridColumnSetDescriptor identifies the column set descriptor or column in the VisibleColumns collection.
Methods
ColIndexToField(Int32)
Converts a column index in a grid to a zero-based number adjusted for column headers (subtracting GetColumnIndentCount()) collection.
Declaration
public int ColIndexToField(int colIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | colIndex | The column index in the grid. |
Returns
| Type | Description |
|---|---|
| System.Int32 | A zero-based number. |
ColumnToRowColIndex(String, out Int32, out Int32)
Returns the relative row and column index in the grid of a column descriptor.
Declaration
public bool ColumnToRowColIndex(string fieldDescriptorName, out int resultRow, out int resultCol)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fieldDescriptorName | The name of the field descriptor (which is GridColumnDescriptor.MappingName). |
| System.Int32 | resultRow | Returns the relative zero-based row index; -1 if column was not found. |
| System.Int32 | resultCol | Returns the relative zero-based column index; -1 if column was not found. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if column was found; False otherwise. |
CreateColumnDescriptorCollection()
Override this factory method if custom properties should be added to the column descriptor. You also have to derive GridTableDescriptor and provide a strong typed collection property.
Declaration
protected virtual GridColumnDescriptorCollection CreateColumnDescriptorCollection()
Returns
| Type | Description |
|---|---|
| GridColumnDescriptorCollection | returns GridColumnDescriptorCollection |
Dispose(Boolean)
Overrides and dispose the unmanaged resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
Overrides
EnsureRecordRowColumns()
Recreates the internal RecordRowCoveredRanges and RecordRowColumns if changes were detected in the ColumnSets, VisibleColumns, or Columns collections.
Declaration
public void EnsureRecordRowColumns()
EnsureSummaryDescriptors()
Recreates the Summaries collection if fields, columns, or SummaryRows have changed. Add summaries for calculating the maximum length of columns in the table.
Declaration
public override void EnsureSummaryDescriptors()
Overrides
EnsureSummaryFilterBarChoices(SummaryDescriptorCollection)
This method is called to add summaries for those columns where GridColumnDescriptor.AllowFilter is true. The base class implementation adds a FilterBarChoicesSummary for each column with .AllowFilter set to true.
Declaration
protected virtual void EnsureSummaryFilterBarChoices(SummaryDescriptorCollection summaryDescriptors)
Parameters
| Type | Name | Description |
|---|---|---|
| SummaryDescriptorCollection | summaryDescriptors | The collection where new summaries should be added. |
FieldToColIndex(Int32)
Converts a zero-based number to a column index in a grid adjusted for column headers (adding GetColumnIndentCount()).
Declaration
public int FieldToColIndex(int fieldNum)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | fieldNum | A zero-based number. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The column index in the grid. |
GetColCount()
Returns the number of grid columns to display in grid.
Declaration
public int GetColCount()
Returns
| Type | Description |
|---|---|
| System.Int32 | Number of columns. |
GetColumnDescriptor(String)
Searches for the column descriptor with the specified name.
Declaration
public GridColumnDescriptor GetColumnDescriptor(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the element to locate in the collection. |
Returns
| Type | Description |
|---|---|
| GridColumnDescriptor | The GridColumnDescriptor that matches the name, if found; otherwise, NULL. |
GetColumnIndentCount()
Returns the number of indent columns.
Declaration
public int GetColumnIndentCount()
Returns
| Type | Description |
|---|---|
| System.Int32 | If records don't have nested tables, the method returns GroupedColumns.Count+1; otherwise GroupedColumns.Count+2. |
GetColumnSetColCount()
Used internally.
Declaration
public int GetColumnSetColCount()
Returns
| Type | Description |
|---|---|
| System.Int32 | returns the count of column set |
GetFrozenColumn()
Returns the value of FrozenColumn if valid. An empty string if the parent table has no frozen column specified.
Declaration
public string GetFrozenColumn()
Returns
| Type | Description |
|---|---|
| System.String | The value of FrozenColumn. |
GetFrozenColumnCount()
Returns the number of frozen columns based on the FrozenColumn property.
Declaration
public int GetFrozenColumnCount()
Returns
| Type | Description |
|---|---|
| System.Int32 | Number of frozen columns. |
GetLastColumnIndex()
Returns the last column index where a record field is displayed.
Declaration
public int GetLastColumnIndex()
Returns
| Type | Description |
|---|---|
| System.Int32 | Last column index. |
GetModified()
Determines if any property has been modified.
Declaration
public override bool GetModified()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if modified. |
Overrides
GetRowHeaderWidth()
Returns width specified in TableOptions.RowHeaderWidth if TableOptions.ShowRowHeader is true; 0 otherwise.
Declaration
public int GetRowHeaderWidth()
Returns
| Type | Description |
|---|---|
| System.Int32 | Row header width. |
GetTableIndentWidth()
Returns width specified in TableOptions.IndentWidth if TableOptions.ShowTableIndent is true; 0 otherwise.
Declaration
public int GetTableIndentWidth()
Returns
| Type | Description |
|---|---|
| System.Int32 | Width of indentation of each group. |
GetTotalWidthOfRowHeadersAndIndent()
Calculates the width of row headers and all indent columns before the first record column.
Declaration
public int GetTotalWidthOfRowHeadersAndIndent()
Returns
| Type | Description |
|---|---|
| System.Int32 | Width of row headers and all indent columns |
GetTotalWidthOfRowHeadersAndIndent(Boolean)
Calculates the width of row headers and all indent columns before the first record column.
Declaration
public int GetTotalWidthOfRowHeadersAndIndent(bool includeWidthOfParentTableIndent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | includeWidthOfParentTableIndent | Specifies if width of nested table indents and parent table row headers should be added. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Width of row headers and all indent columns |
InitializeFrom(TableDescriptor)
Initializes this object and copies properties from another object.
Declaration
public override void InitializeFrom(TableDescriptor tableDescriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| TableDescriptor | tableDescriptor | The source object. |
Overrides
InitSortByDisplayMemberCols()
Initiate sort display member columns.
Declaration
protected override void InitSortByDisplayMemberCols()
Overrides
IsDesignTime()
Determines if this object is used by the parent control in design-time.
Declaration
public override bool IsDesignTime()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if it is being used in design-time. |
Overrides
NameToField(String)
Returns the zero-based index for a column. The resulting number can be used as an index to look up a GridColumnDescriptor in the Columns collection.
Declaration
public int NameToField(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the column to be matched. |
Returns
| Type | Description |
|---|---|
| System.Int32 | A zero-based field number in the Columns collection; -1 if not found. |
OnItemPropertiesChanged(EventArgs)
Raises the OnItemPropertiesChanged(EventArgs) event.
Declaration
protected override void OnItemPropertiesChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.EventArgs | e | Event data. |
Overrides
OnPropertyChanged(DescriptorPropertyChangedEventArgs)
Declaration
protected override void OnPropertyChanged(DescriptorPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| DescriptorPropertyChangedEventArgs | e |
Overrides
OnQueryCellStyleInfo(GridTableCellStyleInfoEventArgs)
Raises the QueryCellStyleInfo event.
Declaration
protected virtual void OnQueryCellStyleInfo(GridTableCellStyleInfoEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTableCellStyleInfoEventArgs | e | A GridTableCellStyleInfoEventArgs that contains the event data. |
OnQueryCustomSummary(GridQueryCustomSummaryEventArgs)
Raises the QueryCustomSummary event.
Declaration
protected virtual void OnQueryCustomSummary(GridQueryCustomSummaryEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| GridQueryCustomSummaryEventArgs | e | A GridQueryCustomSummaryEventArgs that contains the event data. |
OnTableSourceListChanged(TableEventArgs)
Raises the TableSourceListChanged event.
Declaration
protected override void OnTableSourceListChanged(TableEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| TableEventArgs | e | TableEventArgs that contains the event data |
Overrides
ResetAppearance()
Discards any changes for the Appearance object.
Declaration
public void ResetAppearance()
ResetChildGroupOptions()
Discards any changes for the ChildGroupOptions object.
Declaration
public void ResetChildGroupOptions()
ResetColumns()
Resets the Columns collection back to its default state.
Declaration
public void ResetColumns()
ResetColumnSets()
Clears the ColumnSets collection.
Declaration
public void ResetColumnSets()
ResetConditionalFormats()
Clears the ConditionalFormats collection.
Declaration
public void ResetConditionalFormats()
ResetRelations()
Resets the Relations collection back to its default state.
Declaration
public void ResetRelations()
ResetSortByDisplayMemberCols()
Clears the sortByDisplayMemberCols collection.
Declaration
public void ResetSortByDisplayMemberCols()
ResetStackedHeaderRows()
Clears the StackedHeaderRows collection.
Declaration
public void ResetStackedHeaderRows()
ResetSummaryRows()
Clears the SummaryRows collection.
Declaration
public void ResetSummaryRows()
ResetTableDescriptor()
Discards any changes for the TableDescriptor object.
Declaration
public override void ResetTableDescriptor()
Overrides
ResetTableOptions()
Discards any changes for the TableOptions object.
Declaration
public void ResetTableOptions()
ResetTopLevelGroupOptions()
Discards any changes for the TopLevelGroupOptions object.
Declaration
public void ResetTopLevelGroupOptions()
ResetVisibleColumns()
Resets the VisibleColumns collection back to its default state.
Declaration
public void ResetVisibleColumns()
Search(String)
Performs searching in all the columns.
Declaration
public void Search(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | Text to be searched. |
Search(String, List<GridColumnDescriptor>)
Performs searching in User-Specified columns.
Declaration
public void Search(string text, List<GridColumnDescriptor> list)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | Text to be searched |
| System.Collections.Generic.List<GridColumnDescriptor> | list | Columns where the text has to be searched |
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. |
ShouldSerializeChildGroupOptions()
Determines whether ChildGroupOptions were modified and contents should be serialized at design-time.
Declaration
public bool ShouldSerializeChildGroupOptions()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if contents were changed; false otherwise. |
ShouldSerializeColumns()
Determines if the Columns collection has been modified from its default state.
Declaration
public bool ShouldSerializeColumns()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if it is modified; false otherwise. |
ShouldSerializeColumnSets()
Determines if the ColumnSets collection contains values.
Declaration
public bool ShouldSerializeColumnSets()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if not empty; False otherwise. |
ShouldSerializeConditionalFormats()
Determines if the ConditionalFormats collection contains values.
Declaration
public bool ShouldSerializeConditionalFormats()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if not empty; False otherwise. |
ShouldSerializeRelations()
Determines if the Relations collection or child objects have been modified from its default state.
Declaration
public bool ShouldSerializeRelations()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the collection was modified. |
ShouldSerializeStackedHeaderRows()
Determines if the StackedHeaderRows collection contains values.
Declaration
public bool ShouldSerializeStackedHeaderRows()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if not empty; False otherwise. |
ShouldSerializeSummaries()
Determines if the summaries were modified.
Declaration
public override bool ShouldSerializeSummaries()
Returns
| Type | Description |
|---|---|
| System.Boolean | returns False. |
Overrides
ShouldSerializeSummaryRows()
Determines if the SummaryRows collection contains values.
Declaration
public bool ShouldSerializeSummaryRows()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if not empty; False otherwise. |
ShouldSerializeTableOptions()
Determines whether TableOptions were modified and contents should be serialized at design-time.
Declaration
public bool ShouldSerializeTableOptions()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if contents were changed; False otherwise. |
ShouldSerializeTopLevelGroupOptions()
Determines whether TopLevelGroupOptions were modified and contents should be serialized at design-time.
Declaration
public bool ShouldSerializeTopLevelGroupOptions()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if contents were changed; False otherwise. |
ShouldSerializeVisibleColumns()
Determines if the VisibleColumns collection has been modified from its default state.
Declaration
public bool ShouldSerializeVisibleColumns()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if it is modified; False otherwise. |
ShouldSortByDisplayMember(SortColumnDescriptor)
Determines if the specified column should be sorted by the DisplayMember. Default behavior of the method is to return false. GridGroupingControl overrides this method and checks whether the GridColumnDescriptor associated with column has its GridColumnDescriptor.SortByDisplayMember property set to true.
Declaration
public override bool ShouldSortByDisplayMember(SortColumnDescriptor cd)
Parameters
| Type | Name | Description |
|---|---|---|
| SortColumnDescriptor | cd | The SortColumnDescriptor. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the column should be sorted by the DisplayMember. |
Overrides
Events
QueryCellStyleInfo
Occurs for each cell before a GridTableModel starts painting and lets users customize the display of cells.
Declaration
public event GridTableCellStyleInfoEventHandler QueryCellStyleInfo
Event Type
| Type |
|---|
| GridTableCellStyleInfoEventHandler |
QueryCustomSummary
Occurs for each GridSummaryColumnDescriptor before the SummaryDescriptor is determined. You must handle this event if you specified Custom as SummaryType.
Declaration
public event GridQueryCustomSummaryEventHandler QueryCustomSummary
Event Type
| Type |
|---|
| GridQueryCustomSummaryEventHandler |
Explicit Interface Implementations
IStandardValuesProvider.GetStandardValues(PropertyDescriptor)
Declaration
ICollection IStandardValuesProvider.GetStandardValues(PropertyDescriptor pd)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.PropertyDescriptor | pd |
Returns
| Type |
|---|
| System.Collections.ICollection |
IGridGroupOptionsSource.GetParentGroupOptionsSource()
Declaration
IGridGroupOptionsSource IGridGroupOptionsSource.GetParentGroupOptionsSource()
Returns
| Type |
|---|
| IGridGroupOptionsSource |
IGridGroupOptionsSource.GroupOptions
Gets the group options.
Declaration
GridGroupOptionsStyleInfo IGridGroupOptionsSource.GroupOptions { get; }
Returns
| Type |
|---|
| GridGroupOptionsStyleInfo |
IGridGroupOptionsSource.HasGroupOptions
Gets the value whether the GroupOptions object has been initialized.
Declaration
bool IGridGroupOptionsSource.HasGroupOptions { get; }
Returns
| Type |
|---|
| System.Boolean |
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()
Returns the GridTableCellAppearance of this element.
Declaration
GridTableCellAppearance IGridTableCellAppearanceSource.GetAppearance()
Returns
| Type | Description |
|---|---|
| GridTableCellAppearance | Returns the GridTableCellAppearance |
IGridTableCellAppearanceSource.GetBaseAppearance()
Returns a GridTableCellAppearance of the first parent element with appearance in the hierarchy.
Declaration
GridTableCellAppearance IGridTableCellAppearanceSource.GetBaseAppearance()
Returns
| Type | Description |
|---|---|
| GridTableCellAppearance | Returns a GridTableCellAppearance |
IGridTableCellAppearanceSource.RaiseAppearanceChanged(GridTableCellStyleInfoChangedEventArgs)
Notifies the host that properties in the Appearance object were changed.
Declaration
void IGridTableCellAppearanceSource.RaiseAppearanceChanged(GridTableCellStyleInfoChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTableCellStyleInfoChangedEventArgs | e |
IGridTableCellAppearanceSource.RaiseAppearanceChanging(GridTableCellStyleInfoChangedEventArgs)
Notifies the host that properties in the Appearance object will be changed.
Declaration
void IGridTableCellAppearanceSource.RaiseAppearanceChanging(GridTableCellStyleInfoChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTableCellStyleInfoChangedEventArgs | e |
IGridTableOptionsSource.GetParentTableOptionsSource()
Declaration
IGridTableOptionsSource IGridTableOptionsSource.GetParentTableOptionsSource()
Returns
| Type |
|---|
| IGridTableOptionsSource |
IGridTableOptionsSource.HasTableOptions
Gets the value indicates whether the TableOptions object have been initialized.
Declaration
bool IGridTableOptionsSource.HasTableOptions { get; }
Returns
| Type |
|---|
| System.Boolean |
IGridTableOptionsSource.RaiseTableOptionsChanged(GridTableOptionsChangedEventArgs)
Declaration
void IGridTableOptionsSource.RaiseTableOptionsChanged(GridTableOptionsChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTableOptionsChangedEventArgs | e |
IGridTableOptionsSource.RaiseTableOptionsChanging(GridTableOptionsChangedEventArgs)
Declaration
void IGridTableOptionsSource.RaiseTableOptionsChanging(GridTableOptionsChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| GridTableOptionsChangedEventArgs | e |