CollectionSourceBase.GetEnumerable(Boolean) Method
Returns a sequence (IEnumerable or IQueryable) 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 |
|
Returns
| Type | Description |
|---|---|
| IEnumerable | The 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];
}