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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

sorting in hierarchy level 1

Thread ID:





52633 Dec 1,2006 08:23 AM UTC Dec 1,2006 08:40 AM UTC WinForms 1
Tags: GridControl
mark xie
Asked On December 1, 2006 08:23 AM UTC


I am using databoundgrid and i have two hierarchy level (0 and 1), how do i sort data by a column in hierarchy level 1 ( the second hierarchy level)?


Administrator [Syncfusion]
Replied On December 1, 2006 08:40 AM UTC

Hi Mark,

Here is some code snippet that sorts the child table records programatically:

DataView dv;
bool True;

private void buttonAdv1_Click(object sender, System.EventArgs e)
GridBoundRecordState rs;
int pos = this.gridDataBoundGrid1.Model.RowCount;
for(int i = 0; i {
rs = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(i);
True = rs.HasChildList;
// Check whether there are child records
dv = rs.ChildList as DataView;
if(dv != null)
// Sort
dv.Sort = "ProductName DESC";
this.gridDataBoundGrid1.RefreshRange(GridRangeInfo.Rows(i + 1, i + rs.ChildCount));
i += rs.ChildCount;

Here is a sample.

Best Regards,


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon