使用Kendo Grid编辑命令按钮

时间:2015-07-01 15:22:25

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

我正在调用kendo grid中的mvc中的编辑命令

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

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

enter image description here

1 个答案:

答案 0 :(得分:2)

请尝试使用beloe代码段。

<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"))
  )
)