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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SortByColumn

Thread ID:

Created:

Updated:

Platform:

Replies:

59327 Apr 11,2007 10:32 AM UTC Apr 11,2007 04:04 PM UTC WinForms 3
loading
Tags: GridControl
Harshad
Asked On April 11, 2007 10:32 AM UTC

Hi I have implemented ICompare for the sorting on the column in the GGC.

I am using the sentence as
this.dgAttributeAnalysis.TableModel.Data.SortByColumn(a, ListSortDirection.Descending, new CustomComparer());

But This is not calling Compare method in my CustomCompare class....Only constructor is execure on new CustomComparer() but Actual method is not getting executed.

please tell me where i am doing wrong....

Administrator [Syncfusion]
Replied On April 11, 2007 02:34 PM UTC

Data.SortByColumn is a GridControlBase method that is only available in a GridControl that holds its own data in the Data object. It does not work in GridGroupingControl.

To sort a column in a GridGroupingControl, you create a SortColumnDescriptor and add it to the SortedColumns collection.

SortColumnDescriptor scd = new SortColumnDescriptor("Col1", ListSortDirection.Ascending);
scd.Comparer = new MyComparer();
gridGroupingControl1.TableDescriptor.SortedColumns.Add(scd);

Harshad
Replied On April 11, 2007 03:20 PM UTC

Hi,

I have used SortColumnDescriptor as suggested.
But I am getting the 0 value always in compare method...not getting the cell value...
GridStyleInfoStore style1 = x as GridStyleInfoStore;
GridStyleInfoStore style2 = y as GridStyleInfoStore;
X & y Always coming as 0

Please tell me where i am doing wrong

haneefm [Syncfusion]
Replied On April 11, 2007 04:04 PM UTC

Hi Harshad,

Here is a forum thread with a sample of a custom sort.

http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=36995

Will this work for you?

Best regards,
Haneef

CONFIRMATION

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.

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

;