This question is locked. New answers and comments are not allowed.
I'm trying to understand the treeview example that Telerik provides. I am looking at the "Binding to Model" example. In the example, there are categories and there are products under each category. Is the example dependent upon the fact that there is a foreign key relationship between the category and the product?
I guess what I'm really asking is: "Is the Telerik code somewhere behind the scenes using a foreign key relationship to build the trees?"
Thanks for the help
I guess what I'm really asking is: "Is the Telerik code somewhere behind the scenes using a foreign key relationship to build the trees?"
Thanks for the help
5 Answers, 1 is accepted
0
Hi NewUser,
No, the treeview is not relying on a foreign key. It relies on a property which returns the children of the designated object.
Regards,
Atanas Korchev
the Telerik team
No, the treeview is not relying on a foreign key. It relies on a property which returns the children of the designated object.
Regards,
Atanas Korchev
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
carlg
Top achievements
Rank 1
answered on 09 Aug 2010, 03:50 PM
Thanks for the quick reply.
I'm still trying to figure out how I can use this control when all of the items in the treeview are coming from the same database table or class and we don't know at runtime how many levels deep the treeview will be.
For example our data looks as follows (all in the same table)
id parentid name
1 Top level
2 1 2nd level
3 1 Another 2nd level item
4 2 3rd level item
So in this example there are 3 tree levels, but more tree levels can be added by adding more rows to the db.
Thanks
I'm still trying to figure out how I can use this control when all of the items in the treeview are coming from the same database table or class and we don't know at runtime how many levels deep the treeview will be.
For example our data looks as follows (all in the same table)
id parentid name
1 Top level
2 1 2nd level
3 1 Another 2nd level item
4 2 3rd level item
So in this example there are 3 tree levels, but more tree levels can be added by adding more rows to the db.
Thanks
0
Hi NewUser,
The drag and drop example shows binding to a similar database table (Employees from Northwind).
Kind regards,
Atanas Korchev
the Telerik team
The drag and drop example shows binding to a similar database table (Employees from Northwind).
Kind regards,
Atanas Korchev
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
carlg
Top achievements
Rank 1
answered on 09 Aug 2010, 05:54 PM
This is a great example. I think it is what I am looking for.
Do you know how I can see the class definitions for the Employee class and the GetRootEmployees method?
Thanks again!
Do you know how I can see the class definitions for the Employee class and the GetRootEmployees method?
Thanks again!
0
Hello NewUser,
Those are all provided in the sample application. I suggest you download it and check it out in visual studio.
All the best,
Atanas Korchev
the Telerik team
Those are all provided in the sample application. I suggest you download it and check it out in visual studio.
All the best,
Atanas Korchev
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