Set theme from code behind

2 posts, 0 answers
  1. Tad
    Tad avatar
    15 posts
    Member since:
    Jul 2007

    Posted 20 May 2009 Link to this post

    Can you please post some sample code as to how I could change the theme for a chart in code behind?  I just want to switch from the balck theme to either Vista or Simple.

     For the life of me I can't find the method or property to set.


    --Tad Richard
  2. Ves
    Ves avatar
    2870 posts

    Posted 21 May 2009 Link to this post

    Hi Tad,

    You can set it just as any other attached property:
    RadChart1.SetValue(StyleManager.ThemeProperty, new VistaTheme());

    You can also use the StyleManager.SetTheme() method:
    StyleManager.SetTheme(RadChart1, new VistaTheme());

    Note, that the Simple theme is not available
    for RadChart yet. We plan to deliver it with Q2 release, expected in July.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft R3 2016 release webinar banner
Back to Top