0
我對Kendo UI比較陌生。我有我的代碼設置像這樣。這基本上顯示每個列中包含下拉列表的可編輯網格,添加另一個記錄將添加一行新的下拉列表。無論如何,我可以一次保存所有行,而不是單獨更新每行。我的代碼是這樣設置的。劍道UI網格保存
<div class="row">
<div class="col-md-12 ">
<h5>Markets:</h5>
@(Html.Kendo().Grid<ETS_Telerik.Models.AddMarketViewModel>()
.Name("MarketGrid")
.Columns(columns =>
{
columns.Bound(p => p.Country).ClientTemplate("#: Country.Name #").Width("200px");
columns.Bound(p => p.State).ClientTemplate("#: State.StateName #").Title("State").Width("200px") ;
columns.Bound(p => p.Name).Width(200);
columns.Command(command => { command.Destroy(); });
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InCell))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.ID);
model.Field(p => p.Country).DefaultValue(ViewData["defaultCountry"]);
model.Field(p => p.State).DefaultValue(ViewData["defaultState"]);
model.Field(p => p.Name).DefaultValue(ViewData["defaultName"]);
})
.Create(update => update.Action("CreateEmployee", "User"))
.Read(read => read.Action("ReadEmployees", "User"))
.Destroy(del=>del.Action("Delete","User"))
.Update(update => update.Action("UpdateEmployees", "User")))
)
</div>
</div>
是你在尋找http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/editing/batch-editing? –
在kendo中嘗試使用外鍵綁定網格(對於下拉列表),Google中有很多例子。 –