How can I fill Tree View with MultiLeveli Data

2 posts, 0 answers
  1. Ahmed
    Ahmed avatar
    55 posts
    Member since:
    Oct 2012

    Posted 05 Jan 2011 Link to this post

    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
  2. Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 05 Jan 2011 Link to this post

    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
  3. DevCraft R3 2016 release webinar banner
Back to Top