aspnetmvc-devexpress-dot-web-dot-mvc-dot-devexpresshelper.md
Specifies the theme to be applied to all DevExpress extensions within an application.
Namespace : DevExpress.Web.Mvc
Assembly : DevExpress.Web.Mvc5.v25.2.dll
NuGet Package : DevExpress.Web.Mvc5
public static string Theme { get; set; }
Public Shared Property Theme As String
| Type | Description |
|---|---|
| String |
A string value specifying the theme name. Refer to Available Themes, for the list of theme names.
|
Refer to Applying Themes to learn more.
_Layout Page:
<head runat="server">
...
<% Html.DevExpress().RenderStyleSheets(Page,
new StyleSheet { ExtensionSuite = ExtensionSuite.GridView, Theme = "Aqua"},
new StyleSheet { ExtensionSuite = ExtensionSuite.PivotGrid, Theme = "Aqua"},
new StyleSheet { ExtensionSuite = ExtensionSuite.HtmlEditor, Theme = "Aqua"},
new StyleSheet { ExtensionSuite = ExtensionSuite.Editors, Theme = "Aqua"},
new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout, Theme = "Aqua"},
new StyleSheet { ExtensionSuite = ExtensionSuite.Chart, Theme = "Aqua"},
new StyleSheet { ExtensionSuite = ExtensionSuite.Report, Theme = "Aqua"}
); %>
</head>
Global.asax.cs Code:
using DevExpress.Web.Mvc;
...
protected void Application_PreRequestHandlerExecute(object sender, EventArgs e) {
DevExpressHelper.Theme = "Aqua";
}
...
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Theme property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
asp-net-mvc-change-themes-on-the-fly/CS/DxWebApp/Global.asax.cs#L32
protected void Application_PreRequestHandlerExecute(object sender, EventArgs e) {
DevExpressHelper.Theme = Utils.CurrentTheme;
DevExpressHelper.GlobalThemeBaseColor = Utils.CurrentThemeColor;
asp-net-mvc-change-themes-on-the-fly/VB/DxWebApp/Global.asax.vb#L34
Protected Sub Application_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
DevExpressHelper.Theme = Utils.CurrentTheme
DevExpressHelper.GlobalThemeBaseColor = Utils.CurrentThemeColor
See Also