New to Telerik UI for WinForms? Start a free 30-day trial

Represents a node in a data-item grouping hierarchy, with a key, optional parent, and virtual access to its items and child groups.

Definition

Namespace:Telerik.WinControls.Data

Assembly:Telerik.WinControls.dll

Type Parameters:

T

The data-item type represented by the group.

Syntax:

C#
public class Group<T> : IReadOnlyCollection<T>, IEnumerable where T : IDataItem

Inheritance: objectGroup<T>

Derived Classes: DataItemGroup<TDataItem>

Implements: IEnumerableIReadOnlyCollection<T>

Constructors

Initializes a group identified by the specified key and parent.

C#
public Group(object key, Group<T> parent)
Parameters:keyobject

The value identifying this group.

parentGroup<T>

The parent group, or null when this is a root group.

Initializes a root group identified by the specified key.

C#
public Group(object key)
Parameters:keyobject

The value identifying this group.

Properties

Gets the groups.

C#
public virtual GroupCollection<T> Groups { get; }
Property Value:

The groups.

Gets or sets the header.

C#
public virtual string Header { get; set; }
Property Value:

The header.

Gets the item count.

C#
public virtual int ItemCount { get; }
Property Value:

The item count.

Items

IList<T>

Provides the backing items to grouping code and derived group types.

C#
protected virtual IList<T> Items { get; }

The base implementation returns null; concrete groups that contain items override this property.

Gets the key of the group.

C#
public object Key { get; }
Property Value:

The key.

Get the zero-based depth of the Group

C#
public int Level { get; }

Gets the parent.

C#
public virtual Group<T> Parent { get; }
Property Value:

The parent.

Gets the item at the specified index.

C#
public virtual T this[int index] { get; }
Parameters:indexint

Implements: IReadOnlyCollection<T>.this[int]

Methods

Determines whether [contains] [the specified item].

C#
public virtual bool Contains(T item)
Parameters:itemT

The item.

Returns:

bool

true if [contains] [the specified item]; otherwise, false.

Implements: IReadOnlyCollection<T>.Contains(T)

Copies this group's items into an array beginning at the specified index.

C#
public virtual void CopyTo(T[] array, int index)
Parameters:arrayT[]

The destination array.

indexint

The zero-based destination index at which copying begins.

Implements: IReadOnlyCollection<T>.CopyTo(T[], int)

Evaluates the specified expression.

C#
public object Evaluate(string expression)
Parameters:expressionstring

The expression.

Returns:

object

Enumerates the items contained directly in this group.

C#
public virtual IEnumerator<T> GetEnumerator()
Returns:

IEnumerator<T>

An enumerator over this group's items.

Indexes the of.

C#
public virtual int IndexOf(T item)
Parameters:itemT

The item.

Returns:

int

Implements: IReadOnlyCollection<T>.IndexOf(T)