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

Gridgroupingcontrol not sorting

Hello,

We are using a gridGroupingControl in a C# WindowsForm application.

Our data is stored in a SortedList where T is a custom class.
We bind the data to the grid with the following code :

----code-----
gridGroupingControl1.dataSource = new List(from x in slist.Values where x.attrib = "test" select x);
-------------

We then have real time updates on the data. The grid doesn't refresh naturally but we use
gridGroupControL1.Table.SimulateListChanged(new ListChangedEventArgs(ListChangedType.Reset,0));
and the refresh is fine.

We then sort the data by clicking on a column header.
The problem is the grid won't resort automatically when the data is updated. Sorting seems very natural in syncfusion samples, but every sample involve Dataset instead of List.
At the moment we use an ugly code to perform the dynamic sorting, which consist in removing sortedcolumn and reseting it every second. But this last solution is very poor in terms of performance.


Do you have any ideas on why our grid doesn't re-sort when dataSource is updated ?


Thanks in advance.




1 Reply

JJ Jisha Joy Syncfusion Team March 30, 2011 11:41 AM UTC

Hi Florian,

The custom collection must implement INotifiedPropertyChanged interface used to make the collection aware of any property changes. Please refer to the following browser sample for more details,

...\Windows\Grid.Grouping.Windows\Samples\2.0\Custom Collections\IBindingList Demo\cs


Regards,
Jisha


Loader.
Live Chat Icon For mobile
Up arrow icon