Enumerable I'm using a SfListView which is connected to a DataSource, the DataSource.Source is an IEnumerable<MyModel> this all seems to work fine and display the data as expected and if the underlying database should change, calling DataSource.Refresh() does the job.
The problem starts when I try to sort the DataSource:
DataSource.SortDescriptors.Clear();
DataSource.SortDescriptors.Add(new SortDescriptor
{
PropertyName = "DataRow.Name",
Direction = _sortDirection
});
throws a NullReferenceException on the Add method.
Now if I change the DataSource.Source to a List<> or ObservableCollection<>, the sorting code as above works fine. The problem then is when I call DataSource.Refresh, the data does not update as the underlying List/Collection has not changed.
Is it not possible to sort the DataSource when the Source is IEnumerable , is it recommended i perform the sort in the linq ?