Using treelist without children

8 posts, 1 answers
  1. Patrick
    Patrick avatar
    20 posts
    Member since:
    Feb 2008

    Posted 16 Mar 2011 Link to this post

    Hello,

    I have created a usercontrol where I show an overview of rows from an entity. So far all this entities had a hierarchie (parentid). Now I have an entity (table) without a hierarchie. In other words, the treelist only have to show one level. Because I want to reuse this usercontrol I like to know if it is possible. I had removed the property ParentDataKeyNames but that the Exception:

    KeyNames collection length must match ParentKeyNames collection length.


    Is it possible what I want?

    Kind regards,

    Patrick
  2. Answer
    Mira
    Admin
    Mira avatar
    1124 posts

    Posted 17 Mar 2011 Link to this post

    Hello Patrick,

    In order to have all items as roots items in the RadTreeList, their parent data key value should be NULL or the default value for the type.

    To overcome this, you can use the approach from the project attached to this message.

    However, I recommend the usage of RadGrid in this scenario.

    Best wishes,
    Mira
    the Telerik team
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Patrick
    Patrick avatar
    20 posts
    Member since:
    Feb 2008

    Posted 17 Mar 2011 Link to this post

    Thx, that did the job!
  5. Chris @ Intrinsic
    Chris @ Intrinsic avatar
    98 posts
    Member since:
    Oct 2010

    Posted 28 Mar 2011 Link to this post

    One question i hve for treelist:  Can I have multiple tables implemented in the treelist?  for example Users --> Addresses  (where users have multiple addresses),  so it is a standard one to many relationship, and the tables are not self referencing.  I want to be able to use the treelist because it is the most visually 'correct' way that the customer wants to view and edit the data.

    Thanks.
  6. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 29 Mar 2011 Link to this post

    Hi Chris,

    RadTreeList supports only self-referencing tables/structures. If you need to use several source tables to represent hierarchy, consider using our AJAX web grid for this purpose. Review the demos under the 'Hierarchy' node here for more details:

    http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx
     
    Best regards,
    Sebastian
    the Telerik team
  7. Chris @ Intrinsic
    Chris @ Intrinsic avatar
    98 posts
    Member since:
    Oct 2010

    Posted 29 Mar 2011 Link to this post

    Ok.  Thanks very much.  What about your listview control?  What advantage does listview have over gridview in this situation?

  8. Chris @ Intrinsic
    Chris @ Intrinsic avatar
    98 posts
    Member since:
    Oct 2010

    Posted 29 Mar 2011 Link to this post

    Ok.  Thanks very much.  What about your listview control?  What advantage does listview have over gridview in this situation?

    Also for gridview, is it possible to have the lines on it to make it look like the treelist does?

    Thank you again.


  9. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 30 Mar 2011 Link to this post

    Hello Chris,

    Our AJAX ListView control is used to display flat data structures using a set of predefined or custom layouts. To align the columns in each level of a RadGrid hierarchy, utilize the solution depicted here.
     
    Best regards,
    Sebastian
    the Telerik team
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017