【问题标题】:Edit Command Button with Kendo Grid使用 Kendo Grid 编辑命令按钮
【发布时间】:2015-07-01 15:22:25
【问题描述】:

我在剑道网格上的 mvc 中调用一个编辑命令

columns.Command(command =>
{
     command.Edit();
     // command.Destroy().HtmlAttributes(new { @class = "onboard-delete " });
})

它呈现一个按钮和一个图标。如何更改此命令的外观。我希望它只是一个图标。

【问题讨论】:

    标签: c# asp.net-mvc kendo-ui kendo-grid


    【解决方案1】:

    请尝试使用 beloe 代码 sn-p。

    <style>
        .k-grid-edit .k-icon, .k-grid-update .k-icon, .k-grid-cancel .k-icon {
            margin: 0px !important;
        }
    
        .k-grid-edit {
            background-color: transparent !important;
            border: medium none !important;
            margin: 0 !important;
            min-width: 0 !important;
        }
    </style>
    
    
    @(Html.Kendo().Grid<MvcApplication1.Models.TestModel>()
      .Name("LightsGrid")
      .Columns(col =>
      {
          col.Bound(x => x.ID);
          col.Command(command =>
          {
              command.Edit()
                 .Text(" ")
                 .UpdateText(" ")
                 .CancelText(" ");
    
          });
    
      })
      .ToolBar(toolbar => toolbar.Create())
      .Editable()
      .DataSource(dataSource => dataSource
          .Ajax()
          .Model(model => model.Id(x => x.ID))
          .Read(read => read.Action("GetData", "Home"))
          .Create(create => create.Action("CreateData", "Home"))
          .Update(update => update.Action("UpdateData", "Home"))
          .Destroy(destroy => destroy.Action("DestroyData", "Home"))
      )
    )
    

    【讨论】:

    • 这行得通,但它仍然留下按钮背景。我已经更新了原帖
    猜你喜欢
    • 2015-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-09
    相关资源
    最近更新 更多