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 UnClicked Column

Thread ID:





43488 Apr 24,2006 03:44 PM UTC Apr 25,2006 02:18 PM UTC WinForms 3
Tags: GridControl
Chris Wescott
Asked On April 24, 2006 03:44 PM UTC

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


Chris Wescott
Replied On April 24, 2006 03:47 PM UTC

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 07:01 AM UTC

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 02:18 PM UTC

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


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