Hi,
We are using Kendo Data Grid, we are trying to edit the record that will go to a new page (cshtml) and passing a parameter like the ID.
Below is the code but it is not working at all. Please advise, TIA.
index.cshtml
@(Html.Kendo().Grid<iOneDistribution.Web.Models.Users.UserViewModel>()
.Name("grid")
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(u => u.UserCode))
.Read(read => read.Action("Users_Read", "Users"))
.Update(update => update.Action("Update", "Users"))
)
.Columns(columns =>
{
columns.Command(c => c.Edit());
columns.Bound(c => c.UserCode);
columns.Bound(c => c.Acronym);
columns.Bound(c => c.IsActive);
columns.Bound(c => c.IsAllowApprove);
columns.Bound(c => c.DefaultCulture);
})
.Pageable()
.Sortable(sortable =>
{
sortable.SortMode(GridSortMode.SingleColumn);
})
.Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("_UserEdit"))
.Filterable()
.Scrollable()
)
for the _useredit.cshtml
@model iOneDistribution.Web.Models.Users.UserViewModel
<h3>Customized Person edit template</h3>
<br />
@Html.HiddenFor(model => model.UserCode)
<div>
@Html.LabelFor(model => model.Name)
</div>
<div>
@Html.EditorFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name)
</div>
<div>
@Html.LabelFor(model => model.UserGroupCode)
</div>
<div>
@*@Html.Kendo().DateTimePickerFor(model => model.BirthDate)
@Html.ValidationMessageFor(model => model.BirthDate)*@
</div>