Sorting UnClicked Column

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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.

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