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.

Sorting UnClicked Column

Thread ID:

Created:

Updated:

Platform:

Replies:

43488 Apr 24,2006 11:44 AM Apr 25,2006 10:18 AM Windows Forms 3
loading
Tags: GridControl
Chris Wescott
Asked On April 24, 2006 11:44 AM

Hi, I have a ggc with a p-c relationship and I have 2 columns that I need to do something funky with. I have a UWI column and a sortUWI column. The UWI column contains alpha numeric chars so a sort on that column can''t be done properly. So I have built a numeric column SORTUWI and sorting on it will provide the proper results. Now in my parent rows I don''t show SORTUWI, only UWI. When the user clicks to sort on the UWI column I actually need it to sort the SORTUWI column, Ascending/Descending. This part I have done so far. By handling the TableControlQueryAllowSortColumn and adding sort on the SORTUWI column. But I also need to show the user that the UWI column has been sorted ascending/descending. Is there a way make the ascending/descending arrow show. With out actually sorting on that column. Attached is a snippet of my code in the TableControlQueryAllowSortColumn function incase it helps. Regards, Chris Wescott

UWISORT.zip

Chris Wescott
Replied On April 24, 2006 11:47 AM

Hi, Actually I lied, this doesn''t work yet because the e.allowsort = false kills any updates. Maybe this function is not the right one to use? Regards, Chris Wescott

Administrator [Syncfusion]
Replied On April 25, 2006 03:01 AM

Hi Chris, Here is the modified code that works as expected. The sort direction arrow can be displayed in the header cell by setting the sort direction to the particular column header cell’s tag. Let us know if you need any further assistance. Me.GridGroupingControl1.TableModel.HideCols("SORTUWI") = True //Hide the col Private Sub GridGroupingControl1_TableControlQueryAllowSortColumn(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridQueryAllowSortColumnEventArgs) Handles GridGroupingControl1.TableControlQueryAllowSortColumn If e.Column.Name = "UWI" Then e.AllowSort = False If GridGroupingControl1.TableDescriptor.SortedColumns.Contains("SORTUWI") Then If GridGroupingControl1.TableDescriptor.SortedColumns("SORTUWI").SortDirection = System.ComponentModel.ListSortDirection.Ascending Then GridGroupingControl1.TableDescriptor.SortedColumns("SORTUWI").SortDirection = System.ComponentModel.ListSortDirection.Descending e.Column.Appearance.ColumnHeaderCell.Tag = System.ComponentModel.ListSortDirection.Descending Else GridGroupingControl1.TableDescriptor.SortedColumns("SORTUWI").SortDirection = System.ComponentModel.ListSortDirection.Ascending e.Column.Appearance.ColumnHeaderCell.Tag = System.ComponentModel.ListSortDirection.Ascending End If Else ''There should be a sort on SORTUWI already from the Search but this is a double Check GridGroupingControl1.TableDescriptor.SortedColumns.Add("SORTUWI", System.ComponentModel.ListSortDirection.Ascending) e.Column.Appearance.ColumnHeaderCell.Tag = System.ComponentModel.ListSortDirection.Ascending End If ''GridGroupingControl1.Refresh() End If End Sub Regards, Calvin.

Chris Wescott
Replied On April 25, 2006 10:18 AM

Hi Calvin, Thanks for the help, Yet again you guys help me solve a problem. I have said this before to the sales rep but you guys have the best support I have ever seen. Plus it helps that your product is ubber-flexible. Regards, Chris Wescott

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.

;