We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridDataControl errors on sort

I have bound the GridDataControl to an ObjectDataProvider like so:

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
xmlns:MarketFilter="clr-namespace:Chimera.MarketFilter" Loaded="WindowLoaded" >






x:Name="grid"
AutoPopulateColumns="True"
AutoPopulateRelations="False"
ShowAddNewRow="False"
ItemsSource="{Binding Source={StaticResource stocks}}"
ColumnSizer="Auto"
VisualStyle="Office14Silver"
Loaded="GridLoaded"
NotifyPropertyChanges="True" >




the MarketData class is attached. It inherits from ObservableCollection and contains a collection of the Stock class which implements INotifyPropertyChanged. This collection is updated by an event from DataFeed very quickly.

When I click on a column header and it sorts by that column it immediately throws:
A first chance exception of type 'System.InvalidOperationException' occurred in System.dll

Then in a bit:
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll

The rows start to disappear and then the grid is empty.

If I turn off the updating then the problem goes away and I can sort fine off of the starting data.

The error doesn't seem to be coming from my update code, I put a break point in the catch and it never hit.

Seems like a threading issue where access to the ObservableCollection isn't locked.

Any ideas what is causing this?



sorter_2e1667a3.rar

1 Reply

MN Muthulakshmi N Syncfusion Team September 7, 2010 01:05 PM UTC

Hi Blair,

We have checked with our sample as per your request, We are afraid that we were unable to reproduce the issue with “sorting the column header of GridDataControl” which implements INotifyPropertyChanged . Here we have attached a sample for your reference.

Please download the sample from the following location.

Link: http://www.syncfusion.com/uploads/redirect.aspx?file=GDCupdatedata_f2dbd956.zip&team=development

Could you please modify the sample to reproduce the issue.

Let us know if you need any details.

Regards,
Muthulakshmi



Loader.
Live Chat Icon For mobile
Up arrow icon