DevExpress MVC: cannot use custom theme

I am using DevExpress MVC and want to use a custom theme. I got his job to use a standard theme, but he cannot find my own.

I created a custom theme using ASP.NET 12.1 Theme Builder and copied it in my project in App_Themes / MyTheme

I added it using this code:

[Web.config]

<devExpress> ... <themes enableThemesAssembly="true" styleSheetTheme="" theme="MyTheme" /> ... </devExpress> 

[Global.asax.cs]

 protected void Application_PreRequestHandlerExecute(object sender, EventArgs e) { DevExpressHelper.Theme = "MyTheme"; } 

[_ Layout.cshtml]

  @Html.DevExpress().GetStyleSheets( new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout, Theme ="MyTheme" }, new StyleSheet { ExtensionSuite = ExtensionSuite.Editors, Theme ="MyTheme" }, new StyleSheet { ExtensionSuite = ExtensionSuite.HtmlEditor, Theme ="MyTheme" }, new StyleSheet { ExtensionSuite = ExtensionSuite.GridView, Theme ="MyTheme" }, new StyleSheet { ExtensionSuite = ExtensionSuite.PivotGrid, Theme ="MyTheme" }, new StyleSheet { ExtensionSuite = ExtensionSuite.Chart, Theme ="MyTheme" }, new StyleSheet { ExtensionSuite = ExtensionSuite.Report, Theme ="MyTheme" }, new StyleSheet { ExtensionSuite = ExtensionSuite.Scheduler, Theme ="MyTheme" } ) 

[Index.cshtml]

 @Html.DevExpress().GridView( settings => { ... settings.Theme = "MyTheme"; ... }).Bind(Model.SearchResult).GetHtml() 

When I use "Aqua" (standard theme) instead of "MyTheme", my control will be displayed in the Aqua theme. First using "MyTheme", he simply displayed the default default theme, now she says "Unable to find the theme" MyTheme ".

Can someone help me? Thank you, Ioannina

+6
source share
2 answers

Make sure you compile your theme and add a link to it in the bin folder.

This is described in the documentation here.

+1
source

What version of Devexpress are you using?

Version <1.6 has an error with custom themes.

0
source

All Articles