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

Self-referencing Hierarchy

2 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 06 May 2011, 04:06 PM
I am trying to use the RadGrid and the Self-referencing hierarchy concept and had success when pulling all my data from 1 table.  When i put a where clause on the SQLDataSource (where managerid = @managerid (parameter that is passed thru querystring) ) that is attached to the RadGrid I get no results on the grid.  Is the problem that the managerid i put in  has a parentid?  At the root level of my table the record does not have a parentid but i guess my question is can i show all children for a manger that does have a parentid?  Are there any references for using the Self-referencing Hierarchy with SqlDataSource that uses a querystring parameter on the .aspx page?


Thanks.

2 Answers, 1 is accepted

Sort by
0
Patrick
Top achievements
Rank 1
answered on 09 May 2011, 03:17 PM
Can anyone assist me with this issue?

Thanks
0
Mira
Telerik team
answered on 12 May 2011, 08:37 AM
Hello Patrick,

In order to implement a self-referencing grid, you should configure the corresponding fields through the SelfHierarchySettings property of the MasterTableView. The ParentKeyName subproperty has to point to the parent item id, while KeyName references the id value for the current table level.
The root level filter for the grid hierarchy should be defined depending on your source table conventions. I suggest that you do this through the FilterExpression property of the MasterTableView instance.
You can see an example here.

However, I recommend that you use the RadTreeList control for representation of self-hierarchical data.

I hope this helps.

Regards,
Mira
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
Grid
Asked by
Patrick
Top achievements
Rank 1
Answers by
Patrick
Top achievements
Rank 1
Mira
Telerik team
Share this question
or