【问题标题】:How make skin files work with Asp.net mvc 4 and Devexpress 14.1如何使皮肤文件与 Asp.net mvc 4 和 Devexpress 14.1 一起使用
【发布时间】:2014-06-17 15:57:47
【问题描述】:

我想为整个 Web 应用程序设置我的 GridView 设置,这样我就不需要为我创建的每个页面都这样做。

我按照https://help.devexpress.com/#AspNet/CustomDocument14816 中的说明进行操作。我使用“使用与站点相关的 URL”而不是“仅皮肤文件”。它在我的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";
      ...

而且它不显示过滤器栏。我做错了什么?谢谢!

【问题讨论】:

    标签: asp.net-mvc-4 devexpress devexpress-mvc


    【解决方案1】:

    NOTGlobal.asax.cs 中指定 DevExpressHelper.Theme 属性(即,NOT使用 DevExpress 主题方法):

    //DevExpressHelper.Theme = "PlasticBlue";
    

    但是通过 Web.config -> pages -> theme 属性指定主题(即,使用 ASP.NET Theming 方法):

    <pages theme="PlasticBlue">
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-24
      • 2013-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多