2017-02-18 19 views
0

У меня есть код, который выглядит следующим образом:Kendo UI Grid MVC - Почему кнопка редактирования появляется в конце каждой строки, когда установлен режим в ячейке?

@(Html.Kendo().Grid<JeffreysOnline.Entities.Customer>() 
    .Name("grid") 
    .Columns(columns => 
    { 
     columns.Bound(p => p.LastName).Width(150); 
     columns.Bound(p => p.FirstName).Width(125); 
     columns.Bound(p => p.MiddleInitial).Width(75); 
     columns.Bound(p => p.Phone).Width(125); 
     columns.Bound(p => p.Address).Width(150); 
     columns.Bound(p => p.City).Width(100); 
     columns.Bound(p => p.State).Width(50); 
     columns.Bound(p => p.Zip).Width(125); 
     columns.Bound(p => p.TaxName).Width(125); 
     columns.Bound(p => p.TaxId).Width(125); 
     columns.Bound(p => p.BadChecks).Width(125); 
     columns.Bound(p => p.OtherRisk).Width(125); 
     columns.Bound(p => p.Interests).Width(125); 
     columns.Bound(p => p.BirthDate).Width(125); 
     columns.Bound(p => p.BouncedCheck).Width(125); 
     columns.Bound(p => p.PCNumber).Width(125); 
     columns.Bound(p => p.Comments).Width(125); 
     columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200); 
    }) 
    .ToolBar(toolbar => 
    { 
     toolbar.Create(); 
     toolbar.Save(); 
     toolbar.Excel(); 
    }) 
    .Editable(editable => editable.Mode(GridEditMode.InCell)) // In-cell editing instead of the whole row 
    .Pageable() 
    .Navigatable() // This allows the user to tab between columns in the grid. 
    .Sortable() 
    .Scrollable() 
    .Groupable() 
    .Excel(excel => excel 
     .FileName("Customers.xlsx") 
     .Filterable(true) 
     .AllPages(false) 
     .ProxyURL(Url.Action("ExcelExport", "Customer")) 
    ) 
    .HtmlAttributes(new { style = "height:700px;" }) 
    .DataSource(dataSource => dataSource 
     .Ajax() 
     .Batch(true)           // We want to perform batch operations 
     .PageSize(500)           // Set the page size 
     .Events(events => events.Error("error_handler"))  // Define a function that gets called on an error 
     .Model(model => model.Id(p => p.RowId))     // Define the PK 
     .Create(update => update.Action("Create", "Customer")) // The Create method in the controller 
     .Read(read => read.Action("Read", "Customer"))   // The Read method in the controller 
     .Update(update => update.Action("Update", "Customer")) // The Update method in the controller 
     .Destroy(update => update.Action("Delete", "Customer")) // The Delete method in the controller 
    ) 

Когда сетка делает на странице, кнопка Edit появляется в последнем столбце:

enter image description here

Почему это редактировать кнопка появляется, когда У меня есть режим редактирования в ячейке?

ответ

1

Вы хотите отметить Edit button? Вы хотите добавить его в свой код здесь:

columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200); 

Удалите command.Edit(); заявление и кнопка должна исчезнуть.

 Смежные вопросы

  • Нет связанных вопросов^_^