or
@(Html.Kendo().Grid(Model.Users)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(u => u.UserView.CreatedOn).Format("{0:g}");
columns.Bound(u => u.UserView.ID).Title("").Sortable(false).Width(100)
.ClientTemplate("<
a
class
=
'button'
href='" +
Url.Action("EditUser", "Admin") +
"/#= UserView.ID #'" +
">Edit</
a
>"
);
})
.Pageable()
.Sortable()
.Scrollable(scr => scr.Height(400))
.Resizable(resize => resize.Columns(true))
.DataSource(dataSource => dataSource.Ajax().ServerOperation(false)))
@(Html.Kendo().Grid(Model.Users)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(u => u.UserView.CreatedOn).ClientTemplate("#=CreatedOn ? kendo.format('{0:d}', kendo.parseDate(CreatedOn)) : ''#");
columns.Bound(u => u.UserView.ID).Title("").Sortable(false).Width(100)
.ClientTemplate("<
a
class
=
'button'
href='" +
Url.Action("EditUser", "Admin") +
"/#= UserView.ID #'" +
">Edit</
a
>"
);
})
.Pageable()
.Sortable()
.Scrollable(scr => scr.Height(400))
.Resizable(resize => resize.Columns(true))
.DataSource(dataSource => dataSource.Ajax().ServerOperation(false)))
<
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());
}