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

RadTreeViewItem Level and StyleSelector

2 Answers 86 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 12 Mar 2012, 07:36 PM
I'm using a StyleSelector to set the style of the different Items in my  RadTreeView, and I noticed that, when the item is analyzed by the StyleSelector to choose a style, i.e. at the SelectStyle method, the Level of the container is not set. Is this by design or a bug?

If by design, where is it documented? The functionality I'm trying to implement is expanding everything up to the fourth level of my tree view, how can I do this without using the Level property in the Style selector?

2 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 12 Mar 2012, 09:50 PM
Just figured out I'll use the ItemPrepared event to handle the Level issue, but I'd still like to know where is this issue documented or why is it not documented.
0
Petar Mladenov
Telerik team
answered on 15 Mar 2012, 10:55 AM
Hello David ,

 Yes this is by design, the Level property is set later than the SelectStyle method. I believe we haven't documented this because we have never received a reported that this might be an issue in particular scenarios. Could you please elaborate more on yours? If expanding particular nodes is your main goal, this is usually achieved with databinding. The RadTreeView is bound to collection of ViewModels and a boolean property from the ViewModel class is bound to the IsExpanded property of the RadTreeViewItem via StyleBindings(WPF 4, SL5) or ContainerBindings(SL4).

Greetings,
Petar Mladenov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
TreeView
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or