【问题标题】:How to add class to a kendo grid table header?如何将类添加到剑道网格表头?
【发布时间】:2014-10-13 08:18:18
【问题描述】:

这是我的剑道网格,

@(Html.Kendo().Grid<example.Web.Areas.Models.PredictedValues>()
    .Name("MyGrid")
    .Columns(column =>
    {
        column.Bound(p => p.Rlno).Title("Roll no").HtmlAttributes(new { @class =     "someclass" });
        column.Bound(p => p.stdname).Width(60).Title("Std name").HtmlAttributes(new { style = "text-align:right;" });
        column.Bound(p => p.school).Width(50).Title("School").HtmlAttributes(new { style = "text-align:right;" });
    })
))

我需要通过类将一些样式应用于标题名称。包含的@class 不适用于标题。相反,它与表格行绑定。我该怎么做?有什么想法吗?

【问题讨论】:

    标签: html css kendo-ui


    【解决方案1】:

    你试过了吗:

    column.Bound(p => p.Rlno).Title("Roll no").HeaderHtmlAttributes(new { @class = "someclass" });
    

    【讨论】:

      【解决方案2】:

      .HeaderHtmlAttributes 仅向标题添加一个类。

      要向网格单元添加一个 css 类 - 作为一个例子,我的目标是 Status 列 - 你想要设置网格值的样式......你想要这样做。

       columns.Bound(m => m.Status).Title("Status").HtmlAttributes(new { @class = "someclass" });
      

      【讨论】:

        猜你喜欢
        • 2013-06-27
        • 2012-08-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多