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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Sorting a column having a dropdown list in a databound grid by display member

Thread ID:





37221 Nov 17,2005 04:09 PM UTC Nov 17,2005 08:22 PM UTC WinForms 3
Tags: Grouping
Sachin Bamel
Asked On November 17, 2005 04:09 PM UTC

I am using version of syncfusion. I have a databound grid with one of the column having a dropdown. By default the column gets sorted by value member. I need to sort it by display member. To acheive the same, I have implemented IBindingList and overriden the Applysort & used custom sorting. Now the column gets sorted by display member as expected. But Whenever the underlying view gets refilled or changed the container holding the sorted index becomes invalid (for eg. Mine is a tabsheet application & when I go to some other page & come back the view gets refreshed & I get Indexoutof bound of exception. I do not have any way to track when the underlying view of the grid will get changed or refreshed & I have to resort the container which holds the sorted indices. If needed I will send the class I have written. I thank you in advance for the reply. Also similar query I have for the grouping grid.

Administrator [Syncfusion]
Replied On November 17, 2005 05:45 PM UTC

In the case of a DataView, when the datasource is sorted, a ListChanged.Reset event is raised. Are you doing this in your implementation? If you can upload a sample project showing the problem, we can try to debug it here.

Sachin Bamel
Replied On November 17, 2005 07:35 PM UTC

I am calling this.OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1)); Even the sorting is working as expected. The problem occurs when mModelTable.BeginLoadData(); mModelTable.Clear(); mDataAdapter.Fill( mModelTable ); After this the view gets changed & the container which holds the index of the data in the column becomes invalid so I need to resort this array again. Even I somehow took care of these situation. There are couple of other situations where indirectly view gets changed & since I am not able to track them, the container''s indexes gets invalid. I am just attaching the 2 files Referencedataproxy.cs where the IBindingList is implemented and Rowcomparer.cs where I have implemented IComparer interface. I hope you will get some clue out of it.


Administrator [Syncfusion]
Replied On November 17, 2005 08:22 PM UTC

Without a running sample, and being able to debug the behavior it is difficult to be of much help. Just something to try. Before reloading your data, somehow clear the sort so mSortOrder = null; and mView.Sort = "".


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon