GroupBuilder<T>
Used to build groups from indexer
Definition
Namespace:Telerik.WinControls.Data
Assembly:Telerik.WinControls.dll
Type Parameters:
T
The data-item type grouped by this builder.
Syntax:
public class GroupBuilder<T> where T : IDataItem
Inheritance: objectGroupBuilder<T>
Derived Classes:
Constructors
Initializes a group builder that reads items and descriptors from the specified index.
public GroupBuilder(Index<T> index)
The index whose collection view supplies the grouping descriptors and items.
Properties
Gets the collection view associated with this builder.
public RadCollectionView<T> CollectionView { get; }
Gets or sets the comparer used to order sibling groups.
public virtual IComparer<Group<T>> Comparer { get; set; }
Gets the default group predicate.
public virtual GroupPredicate<T> DefaultGroupPredicate { get; }
The group predicate.
Gets or sets the group predicate.
public virtual GroupPredicate<T> GroupPredicate { get; set; }
The group predicate.
Gets the groups.
public GroupCollection<T> Groups { get; }
The groups.
Gets a value indicating whether [needs refresh].
public bool NeedsRefresh { get; }
true if [needs refresh]; otherwise, false.
Methods
Reuses a cached group or creates one through the collection view's group factory.
protected virtual Group<T> GetGroup(GroupCollection<T> cache, Group<T> newGroup, Group<T> parent, object key, int level)
Previously built groups that may be reused.
newGroupGroup<T>The group key used to locate a cached match.
parentGroup<T>The parent group, or null for a root group.
keyobjectThe key passed to the group factory when a new group is needed.
levelintThe hierarchy level of the group.
Returns:Group<T>
The cached group or the newly created group.
Reads and normalizes the item field used as a group key.
protected virtual object GetItemKey(T item, SortDescriptor descriptor)
The item being grouped.
descriptorSortDescriptorThe descriptor identifying the field ordinal.
Returns:The field value, with DBNull converted to null and colors converted to strings.
Performs the grouping operation for specified items.
public virtual GroupCollection<T> Perform(IReadOnlyCollection<T> items, int level, Group<T> parent)
The items.
levelintThe level.
parentGroup<T>The parent.
Returns:The groups built for this level. The collection is empty when the level has no descriptor, the descriptor has no group names, or any group field has an unresolved property index. If paging is applied before grouping, root-level groups are built from the current page only.