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

Custom Themes Not Working Properly

2 Answers 265 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Red Ross
Top achievements
Rank 1
Red Ross asked on 25 Feb 2014, 09:16 PM
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 Answers, 1 is accepted

Sort by
0
Red Ross
Top achievements
Rank 1
answered on 26 Feb 2014, 03:00 PM
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.
0
Dimitar
Telerik team
answered on 27 Feb 2014, 03:44 PM
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:
ThemeResolutionService.LoadPackageFile(@"C:\CustomTheme.tssp");

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.

Regards,
Dimitar
Telerik
Tags
Themes and Visual Style Builder
Asked by
Red Ross
Top achievements
Rank 1
Answers by
Red Ross
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or