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.

how to set child table sorting property in a hierarchical grid

Thread ID:

Created:

Updated:

Platform:

Replies:

9239 Dec 11,2003 05:38 AM Dec 11,2003 08:13 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 11, 2003 05:38 AM

Hi, This is actually a continuation on my previous question. In a hierarchical grid, is that possible for me to define the sorting property for a childtable, so it will always show in a grid in a sorted way? Especially after I add new rows to the child table. Thanks a lot Chris

Administrator [Syncfusion]
Replied On December 11, 2003 07:17 AM

You can try handling the RowsExpanded and dynamically setting the sort order getting the proper information from the GridBoundRecordState.
private void grid_RowExpanded(object sender, GridRowEventArgs e)
{
	GridBoundRecordState rs = this.grid.Binder.GetRecordStateAtRowIndex(e.RowIndex);
	if(rs.HasChildList)
	{
		rs = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(e.RowIndex + 1);
		DataView dv = ((CurrencyManager)rs.ListManager).List as DataView;
		if(dv != null)
		{
			dv.Sort = dv.Table.Columns[1].ColumnName + " Desc";
		}
	}
}

Administrator [Syncfusion]
Replied On December 11, 2003 08:13 AM

this is a nice solution. THanks a lot >You can try handling the RowsExpanded and dynamically setting the sort order getting the proper information from the GridBoundRecordState. > >
>private void grid_RowExpanded(object sender, GridRowEventArgs e)
>{
>	GridBoundRecordState rs = this.grid.Binder.GetRecordStateAtRowIndex(e.RowIndex);
>	if(rs.HasChildList)
>	{
>		rs = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(e.RowIndex + 1);
>		DataView dv = ((CurrencyManager)rs.ListManager).List as DataView;
>		if(dv != null)
>		{
>			dv.Sort = dv.Table.Columns[1].ColumnName + " Desc";
>		}
>	}
>}
>

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.

;