HA
haneefm
Syncfusion Team
June 25, 2007 03:52 PM UTC
Hi Harshad,
This can be achieved by handling a the TableControlQueryAllowSortColumn event handler and add the new sortcolumn to the child table based on the parent table. Here is a code snippet to show this.
void hierarchyGrid_TableControlQueryAllowSortColumn(object sender, GridQueryAllowSortColumnEventArgs e)
{
if (e.Column.Name == "parentID")
{
bool IsSortedColumn = e.TableControl.TableDescriptor.SortedColumns.Contains(e.Column.Name);
ListSortDirection direction = ListSortDirection.Ascending;
if (IsSortedColumn)
{
direction = e.TableControl.TableDescriptor.SortedColumns[e.Column.Name].SortDirection;
}
GridGroupingControl grid = sender as GridGroupingControl;
GridTableDescriptor td = grid.GetTableDescriptor("ChildTable");
td.SortedColumns.Clear();
td.SortedColumns.Add("childID", direction);
}
}
Best regards,
Haneef