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

How can I fill Tree View with MultiLeveli Data

1 Answer 34 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 05 Jan 2011, 02:09 PM
I want to fill Tree View With MultiLevel Data Like if I have 2 Tables in My DataBase ...... Category, Products and Product have CategoryID as Foriegn Key .... I use ADO.NET Entity Framework and Silverlight i want to show it like ....................
Hardware as Parent and Its Childs is (Monitor, Processor, MotherBoard) , Software as Parent and Its Childs like (Windows, Office ..) Something Like That

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 05 Jan 2011, 05:56 PM
Hello Ahmed,

I attached a sample demonstrating similar scenario. The main problem in your case is that Hardware and Software probably doesn`t share common predecessor class. If these classes come from the database, you can create a viewmodel classes that wrap them and a base class that they will inherit from.
This way you will be able to place (for instance) Hardware and Software on one and the same tree level. Furthermore, you will be able to use different templates for these two which could be achieved by TemplateSelectors. You can find this approach in the attached solution. Please let me know if you need more info on this.

All the best,
Petar Mladenov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
TreeView
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or