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

Exposes either groups generated from the list view's data view or caller-defined groups. Collection access uses caller-defined groups when EnableCustomGrouping is enabled or the list view is in design mode. Event forwarding is controlled by EnableCustomGrouping and is suppressed during update batches.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class ListViewDataItemGroupCollection : IList, ICollection, IEnumerable, INotifyCollectionChanged

Inheritance: objectListViewDataItemGroupCollection

Implements: ICollectionIEnumerableIListINotifyCollectionChanged

Constructors

Creates a group collection associated with the specified list view element.

C#
public ListViewDataItemGroupCollection(RadListViewElement owner)
Parameters:ownerRadListViewElement

The element that owns and configures the groups.

Fields

Holds groups generated from the list view's data-view group descriptors.

C#
protected ObservableCollection<ListViewDataItemGroup> autoGroups

Holds groups added directly through this collection.

C#
protected ObservableCollection<ListViewDataItemGroup> customGroups

References the list view element that supplies the grouping mode and data view.

C#
protected RadListViewElement owner

Properties

Gets the number of groups in the active collection.

C#
public int Count { get; }

Implements: ICollection.Count

Gets whether the active collection is read-only. Automatically generated groups are read-only; custom groups can be edited when custom grouping is enabled or in design mode.

C#
public bool IsReadOnly { get; }

Implements: IList.IsReadOnly

Gets whether access to the active group collection is synchronized.

C#
public bool IsSynchronized { get; }

Implements: ICollection.IsSynchronized

Gets the synchronization object used by the active group collection.

C#
public object SyncRoot { get; }

Implements: ICollection.SyncRoot

Gets a group from the active collection or replaces a group in the custom group list.

C#
public ListViewDataItemGroup this[int index] { get; set; }
Parameters:indexint

The zero-based position in the active collection or custom group list.

Property Value:

The group at the specified position.

Methods

Adds a group to the custom group list. The custom list is active when custom grouping is enabled or the list view is in design mode.

C#
public void Add(ListViewDataItemGroup item)
Parameters:itemListViewDataItemGroup

The group to add.

Adds each group to the custom group list while collection change notifications are suppressed. The custom groups are active when custom grouping is enabled or the list view is in design mode.

C#
public virtual void AddRange(params ListViewDataItemGroup[] listViewDataItemGroups)
Parameters:listViewDataItemGroupsListViewDataItemGroup[]

The groups to add.

Suppresses forwarding of group collection change notifications raised during the batch. Pair this call with EndUpdate() to restore notification forwarding.

C#
public virtual void BeginUpdate()

Removes all groups from the custom group list; automatically generated groups are not cleared.

C#
public void Clear()

Implements: IList.Clear()

Determines whether the active collection contains the specified group.

C#
public bool Contains(ListViewDataItemGroup item)
Parameters:itemListViewDataItemGroup

The group to locate.

Returns:

bool

true if the active collection contains the group; otherwise, false.

Copies the groups in the active collection into an array.

C#
public void CopyTo(Array array, int index)
Parameters:arrayArray

The destination array.

indexint

The zero-based destination index at which copying begins.

Implements: ICollection.CopyTo(Array, int)

Copies the groups in the active collection into an array.

C#
public void CopyTo(ListViewDataItemGroup[] array, int arrayIndex)
Parameters:arrayListViewDataItemGroup[]

The destination array.

arrayIndexint

The zero-based destination index at which copying begins.

Ends one notification-suppression batch started by BeginUpdate().

C#
public virtual void EndUpdate()

Applies the owner's active filter to the group's item view when filtering is enabled.

C#
protected virtual void EnsureFilterPredicate(ListViewDataItemGroup item)
Parameters:itemListViewDataItemGroup

The group whose item view receives the filter.

Enumerates the groups in the active collection.

C#
public IEnumerator<ListViewDataItemGroup> GetEnumerator()
Returns:

IEnumerator<ListViewDataItemGroup>

An enumerator over the active groups.

Finds a group in the active collection.

C#
public int IndexOf(ListViewDataItemGroup item)
Parameters:itemListViewDataItemGroup

The group to locate.

Returns:

int

The zero-based position of the group, or -1 if it is not in the active collection.

Inserts a group into the custom group list. The custom list is active when custom grouping is enabled or the list view is in design mode.

C#
public void Insert(int index, ListViewDataItemGroup item)
Parameters:indexint

The zero-based insertion position.

itemListViewDataItemGroup

The group to insert.

Removes a group from the custom group list.

C#
public bool Remove(ListViewDataItemGroup item)
Parameters:itemListViewDataItemGroup

The group to remove.

Returns:

bool

true if the custom group list contained and removed the group; otherwise, false.

Removes the custom group at the specified position.

C#
public void RemoveAt(int index)
Parameters:indexint

The zero-based position of the group to remove.

Implements: IList.RemoveAt(int)

Events

Occurs when automatic groups change while custom grouping is disabled or custom groups change while it is enabled. Notifications raised during update batches are suppressed. In design mode, collection access uses custom groups even when event forwarding still follows the property value.

C#
public event NotifyCollectionChangedEventHandler CollectionChanged

Implements: INotifyCollectionChanged.CollectionChanged