Skip to main content
All docs
V26.1
  • 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

    public IEnumerable GetEnumerable(
        bool wrapNotifications = true
    )

    Optional Parameters

    Name Type Default Description
    wrapNotifications Boolean True

    true if the returned sequence should implement the INotifyCollectionChanged interface; otherwise, false. The method considers this parameter only if the original collection implements the IBindingList interface.

    Returns

    Type Description
    IEnumerable

    The sequence of objects from the original collection.
    null if the original collection does not implement the IEnumerable interface.

    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];
    }
    
    See Also