CollectionSourceBase.GetEnumerable<T>(Boolean) Method
Returns a strongly typed sequence (IEnumerable<T> or IQueryable<T>) of objects from the original collection.
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v26.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Optional Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| wrapNotifications | Boolean | True |
|
Type Parameters
| Name | Description |
|---|---|
| T | The type of objects in the sequence. The type parameter should match the ObjectTypeInfo.Type property value. |
Returns
| Type | Description |
|---|---|
| IEnumerable<T> | The strongly typed sequence of objects from the original collection. |
Remarks
The GetEnumerable method returns null when the original collection does not implement the IEnumerable interface. For example, the underlying data source does not implement this interface when a List View uses Server, ServerView, InstantFeedback, or InstantFeedbackView data access mode.
To access the data in Server and ServerView modes, you can use the Collection property to get the list of objects:
var list = (ListView.CollectionSource.Collection as System.ComponentModel.IListSource).GetList();
for (int i = 0; i < list.Count; i++) {
object obj = list[i];
}