Interface IGroupingList
Provides the functionality that implements customized sorting routines for the engine as shown in the Grid / Grouping / GroupingPerf sample.
Namespace: Syncfusion.Grouping
Assembly: Syncfusion.Grouping.Base.dll
Syntax
public interface IGroupingList
Properties
AllowItemReference
Gets the value that indicates whether the item reference is allowed or not.
Declaration
bool AllowItemReference { get; }
Property Value
Type |
---|
System.Boolean |
Remarks
When you allow item references, the Record.GetData() call will cache and save a reference to the data object for that specific row (e.g. with a DataTable, the data object is a DataRow). If you do not allow item references, Record.GetData() will always get the data from the data source and will not cache it. Depending on how fast lookups are in your data source, AllowItemReference might speed things up a bit.
The default behavior in the engine is that if the data source is a DataView, the engine does internally have AllowItemReference = True in the grouping engine. For other data sources, we usually don�t because we do not know if is safe to keep references to the rows.
The engine has an internal version field for the source list. When the list is sorted, this version field is increased. That means no matter what you specify for AllowItemReference, the Record.GetData() will ask your Data source for a reference and not rely on its cache. A ListChanged event also increases that version field. So, after a ListChanged event any subsequent call to Record.GetData will result in querying your data source the first time. When Record.GetData() is called a second time on a record, it will return the cached row.
GroupingSortBehavior
Gets the value of sort behavior of the table.
Declaration
GroupingSortBehavior GroupingSortBehavior { get; }
Property Value
Type |
---|
GroupingSortBehavior |
Remarks
The engine has a built-in optimization when you change sort columns that allows it to perform the sorting on an on-demand basis group-by-group. Suppose you have a table with 200 different countries and you change the sort order of the cities. It is not necessary to sort the whole table. Instead, the individual groups can be sorted when they are scrolled into view. Such on-demand sorting can only be done with internal sort routines and not by letting your data source do the sorting.
If you return GroupByGroup, you allow this optimization. IGroupingList.ApplySort will not be called when the table is already sorted by grouped or relation child columns.
If you return Table, you do not allow this optimization. In that case, the whole table will be sorted and IGroupingList.ApplySort is called.
SupportsGroupSorting
Gets the value indicating whether group sorting is enabled or not.
Declaration
bool SupportsGroupSorting { get; }
Property Value
Type |
---|
System.Boolean |
Remarks
Specifies if the list's ApplySort(RelationChildColumnDescriptorCollection, SortColumnDescriptorCollection, SortColumnDescriptorCollection) routine should be called instead of having the engine sort the data. Return True if you want to provide your own customized sort routine.
Methods
ApplySort(RelationChildColumnDescriptorCollection, SortColumnDescriptorCollection, SortColumnDescriptorCollection)
Sorts the records in the table in the order specified by the column collections passed in as arguments.
Declaration
void ApplySort(RelationChildColumnDescriptorCollection relationChildColumns, SortColumnDescriptorCollection groupColumns, SortColumnDescriptorCollection sortColumns)
Parameters
Type | Name | Description |
---|---|---|
RelationChildColumnDescriptorCollection | relationChildColumns | This has the highest sort precedence. RelationChildColumns will be given when you have a master-details relation between two tables. The child table must be sorted by the columns that are used to identify a record. These columns match the foreign key columns of the parent table. |
SortColumnDescriptorCollection | groupColumns | This has the higher sort precedence than sortColumns. Group columns are the columns that the table is grouped by. |
SortColumnDescriptorCollection | sortColumns | This has the lowest sort precedence. |