or
<
input
id
=
"RowVersion"
name
=
"RowVersion"
type
=
"hidden"
value
=
"AAAAAAAAZZM="
>
<
input
id
=
"RowVersion"
name
=
"RowVersion"
type
=
"hidden"
value
=
"[object Object]"
data-bind
=
"value:RowVersion"
>
[AcceptVerbs(HttpVerbs.Post)]
public
ActionResult Update_User([DataSourceRequest] DataSourceRequest request, UserProfile userprofile)
{
if
(userprofile !=
null
&& ModelState.IsValid)
{
if
(errorcondition)
{
//raise something here that will be picked up by the onError function described above
//to inform the user that some sort or error occured
}
}
else
{
//raise something here that will be picked up by the onError function described above
//to inform the user that the ModelState.IsValid is Invalid
}
return
Json(ModelState.ToDataSourceResult());
}
public class ShrinkCoeffModel
{
[Display(Name = "thickness")]
public virtual int Thickness { get; set; }
[Display(Name = "wett")]
public virtual string[] Wetness { get; set; }
[Display(Name = "coeff")]
public virtual decimal[] Coeff { get; set; }
}
@(
Html.Kendo().Grid(Model)
.Name("ShrinkCoeff")
.ToolBar(commands =>
{
commands.Create();
})
.Columns(columns =>
{
columns.Bound(o => o.Thickness);
for (int i = 0; i <
Model.FirstOrDefault
().Wetness.Count(); i++)
{
columns.Bound(o => o.Wetness[i]);
}
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Width(210).Title("Действия");
})
.Editable(editable => editable.TemplateName("Item").Mode(GridEditMode.PopUp))
.DataSource(dataBinding => dataBinding
.Server()
.Model(model => model.Id(o => o.Thickness))
.Update("Edit", "ShrinkCoeff")
.Create("Create", "ShrinkCoeff")
.Destroy("Delete", "ShrinkCoeff"))
.Pageable()
.Sortable()
.Selectable()
)