Use SQL data to populate TreeView

2 posts, 0 answers
  1. Jason Bourdette
    Jason Bourdette avatar
    77 posts
    Member since:
    Jan 2010

    Posted 03 May 2013 Link to this post

    I have a flat SQL table and i'm wondering if there is an easy way to use that data to populate a RadTreeView control. Currently I take the flat sql table and create a new sql table that is more tree structured, then i use the treeview with the loadondemand property. i'd like to move to using the RadTreeView control and use the flat sql table without having to create a new table.

    Example data i have:
    | id  |  company_name|  product |  ...
      1      company1     product1
      2      company1     product3
      3      company3     product1
      4      company2     product1
      5      company3     product2

    Using a Select * FROM Tablename query can i possibly get that data into a radtreeview so it would look like below.

      * product1
      * product3
      * product1
      * product1
      * product2

  2. Bozhidar
    Bozhidar avatar
    1096 posts

    Posted 06 May 2013 Link to this post

    Hi Jason,

    Please review the following help article that describes what a SQL table should look like in order to be easily bindable to RadTreeView:

    Here are also a couple of variations on how you can bind your treeview:


    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top