This project is read-only.

ItemsSource object type and filtering / sorting issues

Jan 6, 2014 at 5:10 PM
If I make the ItemsSource object an ObservableCollection<T>, or an object that implements INotifyCollectionChanged (see below), then I can update items in the collection and see the change reflected in the display of items in the Extended Data Grid. If I have sorted the Extended Data Grid, the sort is maintained on the Extended Data Grid change or replace all items in the collection.

However, if I try to filter items in the Extended Data Grid based on any column, the Extended Data Grid is empty - unless I select all or none. In some cases, specifically a column that I have that is based on a custom enum, the only means to get anything to display in the grid is to have none of the possible choices selected.

It appears that the only way that the Extended Data Grid filter mechanism works is to make the ItemsSource a List<T>.

In addition, behavior that I noticed is that one must replace the list every time any items are changed in the list, otherwise, the change in the collection is not reflected in the Extended Data Grid. The property implementation that supplies the list must look like this:
        public List<Output> ReportOutput
                return _reportOutput;
                if (_reportOutput != value)
                    _reportOutput = value;
and the class that supplies the List<T> must implement INotifyPropertyChanged. If the list is not replaced on any changes, the Extended Data Grid fails to pick up any changes even if PropertyChanged is fired for "ReportOutput".

I tried deriving a class from List<T> that implements INotifyCollectionChanged, however, the behavior is as described above in that filtering does not work, but changes to items in the list are detected.

It seems to me that maintaining any sort on the Extended Data Grid is a preferable feature. This happens when the backing collection implments INotifyCollectionChanged; however, filtering does not work in this case.
Jan 7, 2014 at 6:52 PM
Can you send me demo project with ObservableCollection , I can test and try to fix it.
Preferably in 2010 or 2008 format.

Jan 8, 2014 at 2:30 AM
Thanks for your reply. I will try to recreate this behavior in a simplified project in the next few days.
Jan 10, 2014 at 5:27 PM
I created this issue in the issues section and attached a simple project that demonstrates the problem. Namely, that when selecting an item to filter for any column, the items disappear from the grid. Note that when selecting all items, all items do appear. I have also included sample code that uses List<T>, but the only way to get that to work is to completely replace the list and fire a property changed event. The code does this for the sake of completeness.