You can examine the RadTreeView DataPopulation in Code-Behind
tutorial to see how to populate the tree component with items in code-behind.
However, please have in mind that both the RadTreeView
and the RadTreeViewItem
classes derive from an ItemsControl
and therefore they both provide Items
collections. This is why I wouldn't recommend nesting RadTreeViews
. In most cases, creating a hierarchy of RadTreeViewItems
results in the very same layout. Please consider that option before building your tree layout and don't hesitate to write back if you have any concerns or questions on that matter.
Also, as you mentioned binding I just wanted to elaborate on the data-binding options available within the RadTreeView
control. Basically as the component is data-driven, it is mostly used to display business collections. And although you can simply set its ItemsSource
to any collection of business items, many developers use the MVVM
pattern in their applications. This is why the ItemsSource property is designed to allow data-binding
thus giving you the chance to easily build MVVM RadTreeView
applications where you define the view entirely in XAML and the data in your business layer.
But if you'd rather manually populate the RadTreeView
declaratively, the tutorial I first mentioned (RadTreeView DataPopulation in Code-Behind
) should get you started. And if you have a business collection that you need to display in the RadTreeView
control, you can set it as its ItemsSource
and then apply ItemTemplates
that control the visualization of the business items.
Let us know if you need more information.
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>