Back to Devexpress

DevExpressHelper.Theme Property

aspnetmvc-devexpress-dot-web-dot-mvc-dot-devexpresshelper.md

latest4.0 KB
Original Source

DevExpressHelper.Theme Property

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

Declaration

csharp
public static string Theme { get; set; }
vb
Public Shared Property Theme As String

Property Value

TypeDescription
String

A string value specifying the theme name. Refer to Available Themes, for the list of theme names.

|

Remarks

Refer to Applying Themes to learn more.

Example

_Layout Page:

aspx
<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:

csharp
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

csharp
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

vb
Protected Sub Application_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
    DevExpressHelper.Theme = Utils.CurrentTheme
    DevExpressHelper.GlobalThemeBaseColor = Utils.CurrentThemeColor

See Also

RenderStyleSheets

GetStyleSheets

StyleSheetTheme

DevExpressHelper Class

DevExpressHelper Members

DevExpress.Web.Mvc Namespace