TreeViewItem font

3 posts, 1 answers
  1. Jean-Francois
    Jean-Francois avatar
    4 posts
    Member since:
    Jul 2010

    Posted 28 Jul 2010 Link to this post

    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. Answer
    Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 02 Aug 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jean-Francois
    Jean-Francois avatar
    4 posts
    Member since:
    Jul 2010

    Posted 02 Aug 2010 Link to this post

    Thank you Hristo, it is now working perfectly !
Back to Top