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.
Unfortunately, activation email could not send to your email. Please try again.

GridControl Sorting

Thread ID:

Created:

Updated:

Platform:

Replies:

90282 Sep 24,2009 04:08 AM Sep 24,2009 07:05 AM Windows Forms 1
loading
Tags: GridControl
Allon
Asked On September 24, 2009 04:08 AM

Hi, everyone

I'd like to know, if there any way to sort rows in GridControl.

My question is if there is a way to sort GridControl based on values of specific column.

If there is no way how can I sort GridControl based on values of specific column using CellClick efficiently?

Something which will be similiar to:

Private Sub grdNew_CellClick(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs) Handles grdNew.CellClick
Select Case e.ColIndex
Case 1

Case 2

End Select
End Sub

Regards, and have a nice day :)
Allon


P.S

I don't use data binding. I add rows programmatically.

Lingaraj S [Syncfusion]
Replied On September 24, 2009 07:05 AM

Hi Allon,

Thank you for your interest in Syncfusion products.

There is no built-in support for sorting rows. But it can be achieved by Custom IComparer's.

Refer the sample from below link to sort a rows:
http://files.syncfusion.com/support/samples/Grid.Windows/Forums/SortRows.zip

Also the GridControl does not have default property to sort the columns with column header. However It can be achieved with Data.SortByColumn method in GridControl. In that method the IComparer object is used to sort the data's in GridControl.

Refer the sample in below link, it demonstrate the Sorting in GridControl.
http://files.syncfusion.com/support/samples/Grid.Windows/7.2.0.37/I57184/GridSort.zip

Refer a another sample in below link, it demonstrate the MutipleColumnSorting in GridControl.
http://files.syncfusion.com/support/samples/Grid.Windows/7.1.0.30/I56819/main1.htm

Please let me know if you have any queries.

Regards,
Lingaraj S.

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.

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.

;