aspnetmvc-14805-common-features-appearance-customization-theming-applying-themes-applying-themes-the-devexpress-approach.md
DevExpress Extensions for ASP.NET MVC ship with a set of built-in predefined visual themes that allow you to provide a consistent appearance through your website. For a list of prepackaged themes, see the Available Themes topic. By default, theme elements of all available built-in themes are embedded as resource files into a specific ASPxThemes Assembly shipped within the installation. To learn more, refer to the DevExpress Themes Overview topic.
Note
You can use the Project Wizard to specify a theme for your newly created web application. The wizard sets the Theme Name attribute in web.config.
To apply a theme to a web application, perform the following steps:
Add the required style sheets to the View using the ExtensionsFactory.GetStyleSheets method.
Specify the extension theme in the Global.asax file or in web.config.
Note that if you only call the ExtensionsFactory.GetStyleSheets method in this implicit manner (i.e., without specifying the theme name via a stylesheet object’s StyleSheet.Theme property), and do not specify a global theme in web.config or via the DevExpress helper’s static property, style sheets of the Default DevExpress theme will be attached. This Default DevExpress theme will automatically be applied to all DevExpress extensions.
If you need to apply a theme to a standalone extension, perform the following steps:
In the View code, add the style sheets for the required extension suite explicitly (by specifying the theme name via a stylesheet object’s StyleSheet.Theme property), as it is shown in a code sample below:
Define the extension’s Theme property value:
Note
When adding style sheets for the HtmlEditor, GridView and TreeList MVC Extensions, you should also add the style sheets for the Data Editors and Navigation and Layout extensions.
The order of precedence for applying a DevExpress theme (from lowest to highest priority) is as follows.
See Also