我正在使用 DevExpress MVC 并想使用自定义主题。我可以使用标准主题,但找不到我的自定义主题。
我使用 ASP.NET 12.1 Theme Builder 创建了自定义主题,并将其复制到我的项目中到 App_Themes/MyTheme
我使用以下代码添加了它:
[网络配置]
<devExpress>
...
<themes enableThemesAssembly="true" styleSheetTheme="" theme="MyTheme" />
...
</devExpress>
[全球.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" }
)
[索引.cshtml]
@Html.DevExpress().GridView(
settings =>
{
...
settings.Theme = "MyTheme";
...
}).Bind(Model.SearchResult).GetHtml()
当我使用“Aqua”(标准主题)而不是“MyTheme”时,我的控件将显示在 Aqua 主题中。首先使用“MyTheme”它只是显示默认的标准主题,现在它说“找不到'MyTheme'主题。”
有人可以帮帮我吗?谢谢,贾尼娜