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.
Syncfusion Feedback

Sorting on child grid

Thread ID:

Created:

Updated:

Platform:

Replies:

62898 Jun 25,2007 02:05 PM UTC Jun 25,2007 03:52 PM UTC Windows Forms 1
loading
Tags: GridControl
Harshad
Asked On June 25, 2007 02:05 PM UTC

Hi,

I am using GGC. I have child table created using the master detail relationship and add under is group. When i sort the Grid Column On grouping summary i want my Child table columns should also get sorted accordingly....
Please tell me how to sort the child table column on click on parent table column heading.

Thanks
Harshad

haneefm [Syncfusion]
Replied On 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

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.

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

;