This is a migrated thread and some comments may be shown as answers.

Databinding a complex hierarchy

1 Answer 43 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jon Barron
Top achievements
Rank 1
Jon Barron asked on 20 Jul 2010, 09:03 PM

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!

1 Answer, 1 is accepted

Sort by
0
Viktor Tsvetkov
Telerik team
answered on 21 Jul 2010, 02:19 PM
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
Tags
TreeView
Asked by
Jon Barron
Top achievements
Rank 1
Answers by
Viktor Tsvetkov
Telerik team
Share this question
or