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

TreeViewItem font

2 Answers 64 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jean-Francois
Top achievements
Rank 1
Jean-Francois asked on 28 Jul 2010, 02:45 PM
I'm trying to change the fontstyle of the a radTreeviewItem. In fact, I want to do this within the code when events are fired. I've tried to add a stackpanel with a textblock in the header but it doesn't seems to work. I've also tried this code:
TextElement.SetFontStyle(treeViewItem, FontStyles.Italic);
without success.

Can you tell me how I could change the font dynamically ?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 02 Aug 2010, 10:23 AM
Hi Jean-Francois,

I'm attaching you a working example containing two instances of RadTreeView. First tree is declared inline. Second one is populated via a data binding. In both cases the font is changed to italic when the item is selected.

Best wishes,
Hristo Milyakov
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
0
Jean-Francois
Top achievements
Rank 1
answered on 02 Aug 2010, 04:02 PM
Thank you Hristo, it is now working perfectly !
Tags
TreeView
Asked by
Jean-Francois
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Jean-Francois
Top achievements
Rank 1
Share this question
or