Custom Themes Not Working Properly

3 posts, 0 answers
  1. Red Ross
    Red Ross avatar
    3 posts
    Member since:
    Oct 2011

    Posted 25 Feb 2014 Link to this post

    As a test, I have created a new custom theme by importing the stock themes from telerik and giving it a new theme name. I have also modified the treeview styles as part of the new theme package. I have tried creating a theme dll as suggested per Telerik documentation but the new theme does not appear in any of the themename drop downs in the property browser. I have also tried the theme manager and embedding the xml files. As I said the only control I modified was the treeview control using Visual Style Builder and everything looks good in the preview pane with the new look and feel - both treeview style and form style. I have saved as both a package and individual xml files and tried both compiling a package dll and embedding the xml files in the project. To no avail, I cannot seem to get this working - the new custom theme does not get applied even typing in the themename for the treeview - I did get the custom theme to stick once or twice in design mode but never in run time mode, not even setting the themes in the form load event. And when I got the theme to stick in design mode, the form style and treeview style were no where near what I saved from VSB - it's like some of the styles/properties etc might be missing as my first thought. I know the the files build action are set to embedded resource and I know the resource name is set right (default namespace.folder path.file.ext).

    Any help or thoughts would be appreciated.
  2. Red Ross
    Red Ross avatar
    3 posts
    Member since:
    Oct 2011

    Posted 26 Feb 2014 in reply to Red Ross Link to this post

    I've created the treeview style from scratch and have no issues. There must be something else in trying to copy over an existing style, modifying it and saving it with a different theme name....but for now I am working.
  3. Dimitar
    Dimitar avatar
    2654 posts

    Posted 27 Feb 2014 Link to this post

    Hi Robert,

    Thank you for contacting us.

    I am not sure what was going wrong with your custom theme. In general the easiest way to load custom theme is to use the LoadPackageFile method:

    This way you can very easy test you theme in a sample project, because you can test any changes momentarily. Then when your theme is ready you can add it as embedded resource to your project. More information is available in the following article: Using custom themes.

    Also I am not sure how you are copying the existing styles, but when you are editing the predefined themes the best approach is to examine which elements have applied repository items (for which states also) and then change them where necessary. This way you will preserve the already created structure of applied styles and also the behavior of the controls will remain intact.

    I hope this helps. Should you have any other questions do not hesitate to ask.

Back to Top