2015-07-01 178 views
1

我在編輯命令,MVC呼籲劍道網編輯命令按鈕與劍道電網

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

它呈現一個按鈕和圖標。我該如何改變這個命令的外觀。我希望它只是一個圖標。

enter image description here

回答

1

請與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")) 
) 
) 
+0

這工作,但它仍然留下按鈕背景。我已更新原始帖子 – TheDizzle

+0

我已更新我的答案。 –