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

Changing the way a treeview node expands

2 Answers 55 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ludovic Gerbault
Top achievements
Rank 1
Ludovic Gerbault asked on 10 Oct 2009, 11:12 AM
Hello

Since I was finally able to build the treeview as I wanted, I am now in the process of styling it.

I can manage to set backgrounds visual states and other properties, but there's one thing I cannot figure out.

My treeview has a maximum of 3 levels.
What I'd like to do is the following :

One single click on the first level will expend normally, behind with a slight indentation.

Among the children of this node, I may have another sublevel that can expend. I'd like this level to expend also on single click, but on the right, align to it's parent node, kind of like any windows application menu. I hope I'm clear enough.

I'm using a single hierarchicalDataTemplate for each level.

Does anyone knows of a way to do that ?

2 Answers, 1 is accepted

Sort by
0
Ludovic Gerbault
Top achievements
Rank 1
answered on 10 Oct 2009, 01:27 PM
Second trick question

Assuming that I have for instance 5 Main RadTreeviewItem, with each an unknown number of children.

The Treeview is bound to a IList retreived from WCF.

How do I, for each main treeviewItem, set a different style, with its own background and visualstate over behaviour.

I'm not talking about styling level1, level2 and level3, but level1-A with style 1, level1-B with style B...
0
Valentin.Stoychev
Telerik team
answered on 14 Oct 2009, 03:57 PM
Hi Subileau Pascal,

The answer to both your questions is called - ItemContainerStyle. You can read more on this here:
http://www.drwpf.com/blog/Home/tabid/36/EntryId/32/Default.aspx

It is for WPF, but the same will apply for Silverlight.

Greetings,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TreeView
Asked by
Ludovic Gerbault
Top achievements
Rank 1
Answers by
Ludovic Gerbault
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Share this question
or