Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
795
possible bug with sorting/grouping and CollectionViewSource
posted

I've got an app that is using WCF Data Services, and a few examples I've seen recommend using a CollectionViewSource for binding but this seems to break the default sorting/grouping logic for unbound columns.

If I directly set the datagrid's ItemsSource to the returned DataServiceCollection<T> sorting and grouping works as expected just using the string returned by my value converter.  

If I use code like this:

CollectionViewSource vs = (CollectionViewSource)this.Resources["ServiceSource"];

vs.Source = thedataservicecollection;

the grid properly displays but sorting or grouping on an unbound column causes an unhandled exception.  The problem took me a while to track down so I'm hoping to save anyone else the headache.

  • 9694
    posted

    Hello,

    I appreciate your post. You may have uncovered a bug. Would you be willing to put together a sample project that illustrates how you are assigning the CollectionView, applying sorting and using UnboundFields and set up the project to reproduce the issue? With a sample, we could see how you came across the issue and determine what is going on that an exception is being thrown.

    If you do post the sample, when you Post there is an Options tab. You can post attachments there. Please make sure to remove binaries and zip the project before posting it.

    Thank you!