Defines a managed view over a collection with capability to sort, group, filter, and limit the number of items in the view.
- Type Parameters:
-
T
-The type.
- Inheritance:
- object object
- Implements:
-
ICollection
View <T> ICollectionView
Remarks
This experimental class is subject to breaking changes and should only be used in conjunction with Actipro controls in the manner directed.
Constructors
CollectionView(IEnumerable<T>)
Initializes an instance of the class.
Parameter | Type | Description |
---|---|---|
collection | IEnumerable<T> | The source collection to be managed by the view. |
Properties
Count
Gets the number of elements contained in the ICollection<T>.
Property Value
- int:
The number of elements contained in the ICollection<T>.
Filter
A filter used to determine which items are included in the view.
Property Value
- Predicate<T>
GroupDescriptions
Defines grouping to be applied to the view.
Property Value
Remarks
Only a single group is supported at this time.
Groups
The groups of items including by the view of this collection.
Property Value
HasFilter
Indicates if the view has defined a filter.
Property Value
HasGroups
Indicates if the view has defined any groups.
Property Value
MaxItemCount
The maximum number of items to be included in the view.
Property Value
SortDescriptions
Defines the order in which items are sorted for the view.
Property Value
Methods
Contains(T)
Determines whether the ICollection<T> contains a specific value.
Parameter | Type | Description |
---|---|---|
value | T |
Returns
- bool:
true
ifitem
is found in the ICollection<T>; otherwise,false
.
GetGroupNames(bool)
Gets the name of the available groups, optionally included groups that are excluded by the current filter.
Parameter | Type | Description |
---|---|---|
ignoreFilter | bool | When |
Returns
GetItemAt(int)
Gets the item at the specified index of the view.
IndexOf(T)
Gets the index of the item within the view.
Parameter | Type | Description |
---|---|---|
item | T | The item to examine. |
Returns
- int:
The index of the item within the view, or
-1
if the item could not be found.
PassesFilter(T)
Tests if an item passes the filter.
Parameter | Type | Description |
---|---|---|
item | T | The item to examine. |
Returns
- bool:
true
if the item passes the filter and should be included in the view; otherwise,false
.
Refresh()
Refreshes the view.
ResolveGroupName(T)
Resolves the group name, if any, that applies to the given item.
Parameter | Type | Description |
---|---|---|
item | T | The item to examine. |
Returns
- string:
The group name, or
null
if a group name is not available.
Events
CollectionChanged
Occurs when the collection changes.
Event Type
Inherited Members
-
object.
Get Type() -
object.
Memberwise Clone() -
object.
To String() -
object.
Equals(object) -
object.
Equals(object, object) -
object.
Reference Equals(object, object) -
object.
Get Hash Code()