我想为整个Web应用程序设置GridView设置,这样我就不需要为我创建的每个页面执行此操作。
我按https://help.devexpress.com/#AspNet/CustomDocument14816所述的方式行事。我使用"使用与网站相关的网址"而不是"只有皮肤文件"。它在我的App_Themes
文件夹中创建主题。然后我添加以下内容:
在global.asax.cs中:
protected void Application_PreRequestHandlerExecute (object sender, EventArgs e)
{
DevExpressHelper.Theme = "PlasticBlue";
}
在web.config中:
<pages validateRequest="false" clientIDMode="AutoID" theme="PlasticBlue">
...
<devExpress>
<themes theme="" enableThemesAssembly="false" styleSheetTheme="" />
</devExpress>
在_Layout.cshtml中
@Html.DevExpress().GetStyleSheets(
new StyleSheet
{
ExtensionSuite = ExtensionSuite.NavigationAndLayout, Theme = "PlasticBlue"
...
在App_Themes / PlasticBlue / MVCxGridView.skin`
中<dxmvc:MVCxGridView runat="server" CssFilePath="~/App_Themes/PlasticBlue/{0}/styles.css" CssPostfix="PlasticBlue" >
<Settings ShowFilterBar="Visible"></Settings>
我使用Grid创建我的视图:
GridViewExtension grid = Html.DevExpress().GridView(settings =>
{
settings.Name = "GridViewjjjjjj";
settings.KeyFieldName = "Id";
...
它没有显示过滤条。我做错了什么?谢谢!
答案 0 :(得分:0)
不指定 Global.asax.cs 中的 DevExpressHelper.Theme 属性(即执行 NOT 使用DevExpress Theming方法):
//DevExpressHelper.Theme = "PlasticBlue";
但是通过 Web.config - &gt;指定主题。页面 - &gt;主题属性(即使用ASP.NET主题方法):
<pages theme="PlasticBlue">