This is a migrated thread and some comments may be shown as answers.

Self-referencing Hierarchy - Limit duplication of Data

2 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 20 Apr 2010, 06:58 PM
Is there a way to limit the duplication of the data displayed?  Currently it shows every line that is returned on the first level and re-shows the line for every item it reports to in the sub-levels.  I used the self-referencing Hierarchy example in the demo to create it.

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Apr 2010, 06:04 PM
Hello John,

Our online demo uses filtering to avoid this behavior:

Sample code:
public void Page_Load(object sender, EventArgs e)
{
    if (Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("3.5") != -1 || Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("4.0") != 1)
    {
        RadGrid1.MasterTableView.FilterExpression = @"it[""ReportsTo""] = Convert.DBNull";
    }
    else
    {
        RadGrid1.MasterTableView.FilterExpression = "ReportsTo IS NULL";
    }
}

Best regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
John
Top achievements
Rank 1
answered on 22 Apr 2010, 06:28 PM
I had taken that section out because it was not returning anything because my top level item was using a parent/reportto of 0 not NULL.  I changed it to NULL and it worked.  Thanks for the help.
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Daniel
Telerik team
John
Top achievements
Rank 1
Share this question
or