Databinding a complex hierarchy

2 posts, 0 answers
  1. Jon Barron
    Jon Barron avatar
    24 posts
    Member since:
    Oct 2012

    Posted 20 Jul 2010 Link to this post


    Hi,
    I've got a complex hierarchy and I'd like to see if it's possible to use the tree control to model it without having to program a bunch of code.

    I've got a class, call it "foo". A "foo" can have a collection of "foo"s, as well as collections of "bar"s and "whatsit"s. I'd like to get the tree to model a foo as follows:

    • Foo 1
      • Foos
        • Foo 3
          • Foos
          • Bars
            • Bar
            • Bar
          • Whatsits
      • Bars
        • Bar
        • Bar
      • Whatsits
        • Whatsit
        • Whatsit
    • Foo 2
      • Foos
        • Foo 4
          • Foos
          • Bars
          • Whatsits
      • Bars
        • Bar
      • Whatsits
        • Whatsit

    So basically, anytime I bind an item of type "foo", it needs to bind with 3 child nodes (foos, bars & whatsits). Expanding a foo node should repeat the heirarchy; expanding a bar or whatsit node gets me the collection of those items.

    Thanks!

  2. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 21 Jul 2010 Link to this post

    Hello Jon Barron,

    Attached is a sample project, could you please review it and tell me if it works for you. If you want to make a different template for each item you should review this article. I will be glad to further assist you if you need so.

    On a side note, I'd like to inform you that we've just released an online tool that allows you to reduce the size of your Silverlight applications. For more information, please visit http://blogs.telerik.com/blogs/posts/10-06-10/telerik_assembly_minifier.aspx

    Best wishes,
    Viktor Tsvetkov
    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
Back to Top