TreeView binding a Table with Id and ParentId

6 posts, 0 answers
  1. sn
    sn avatar
    1 posts
    Member since:
    Apr 2010

    Posted 22 Apr 2010 Link to this post

    Hi,

    I have a table with three fields. These fields are id, Description and ParentId. You can find example data below.

    ID   Description  ParentId
    1    Desc1         null
    2    Desc2         null
    3    Desc3         1
    4    Desc4         2
    5    Desc5         4


    Desc1
      Desc3
    Desc2
      Desc4
           Desc5

    How can I bind this table automatically to the treeview?

    Thank you...

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 27 Apr 2010 Link to this post

    Hello sn,

    It is best to use RIAServices to get the data from your database.

    Once you turn that data into a flat self-referencing collection, you can use the approach, described in this blog post to define the hierarchy and display it in a RadTreeView. 

    Please give it a try and let us know if you have any difficulties.

    Greetings,
    Tina Stancheva
    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.
  3. DevCraft banner
  4. Jorn
    Jorn avatar
    222 posts
    Member since:
    Jun 2009

    Posted 29 Apr 2010 Link to this post

    The blog mentions that the asp.net version of treeview can automatically bind itself to self-referencing data.
    Are there any plans to implement this in the SL version?
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 29 Apr 2010 Link to this post

    Hello Jorn,

    We plan to release PowerTools in the near future where such working prototype will be included. However, I cannot bind to a specific date for now.

    Sincerely yours,
    Tina Stancheva
    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.
  6. Selvakumar Savarimuthu
    Selvakumar Savarimuthu avatar
    23 posts
    Member since:
    Sep 2012

    Posted 16 Nov 2010 Link to this post

    Hi Tina,

    Could you also please help me to achieve drag and drop with self-referencing hierarchy in silverlight 3?

    Thanks,
    Prasanna R
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 17 Nov 2010 Link to this post

    Hi Prasanna R,

    I prepared a sample project illustrating how to implement drag and drop in a RadTreeView populated with a self-referencing flat data collection in Silverlight 3.

    Have a look at it and let me know if it works for you.

    On a side note, I just like to let you know that with our Q3 2010 release, we discontinued our support for RadControls for Silverlight 3 as announced earlier this year (link). With this said, l would like to remind you that any further developments or fixes will be not possible in RadControls for Silverlight 3. You can use our SL 3 controls in your project but we would be able to assist you in your development only with workarounds (when possible) and not with built-in functionality or bugfixes.

    Best wishes,
    Tina Stancheva
    the Telerik team
    See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
Back to Top
DevCraft banner