@(Html.Kendo().Grid<
sss.ViewModels.StudentMarkVM
>()
.Name("grid")
.Columns(columns =>
{
columns.ForeignKey(c => c.StudentId, (System.Collections.IEnumerable)ViewData["students"], "Id", "NameEn");
columns.Bound(c => c.Name).Hidden();
columns.ForeignKey(c => c.MarkStructureId, (System.Collections.IEnumerable)ViewData["markStructures"], "Id", "NameEn");
columns.Bound(c => c.Mark);
columns.Bound(c => c.FullMark);
//.ClientTemplate(Html.Kendo().NumericTextBox<
double
>()
// .Name("Mark_#=Mark#")
// //.Value("#=order#")
// .HtmlAttributes(new { value = "#=Mark #" })
// .Format("{0:n0}")
// .Min(0)
// .Max(100000)
// .Step(1)
// .Decimals(0)
// .Events(ev => ev.Change("numericBoxChanged"))
// .ToClientTemplate().ToHtmlString());
columns.Bound(c => c.IsActive).Hidden();
columns.Bound(c => c.Note).Hidden();
columns.Bound(c => c.UserDefined1).Hidden();
columns.Bound(c => c.UserDefined2).Hidden();
columns.Bound(c => c.UserDefined3).Hidden();
columns.Bound(c => c.UserDefined4).Hidden();
//columns.Bound(c => c.CreationUserName).Hidden();
//columns.Bound(c => c.CreationDate).Hidden().Format("{0:MM/dd/yyyy H:mm}");
//columns.Bound(c => c.LastUpdateUserName).Hidden();
//columns.Bound(c => c.LastUpdateDate).Hidden().Format("{0:MM/dd/yyyy H:mm}");
})
.ToolBar(toolbar =>
{
toolbar.Save();
toolbar.Excel();
toolbar.Pdf();
})
.ColumnMenu()
.Editable(editable => editable.Mode(GridEditMode.InCell))
.HtmlAttributes(new { style = "height: 500px" })
.Selectable(selectable =>
{
selectable.Mode(GridSelectionMode.Single);
selectable.Type(GridSelectionType.Cell);
})
.Sortable(sortable =>
{
sortable.SortMode(GridSortMode.SingleColumn);
})
.HtmlAttributes(new { style = "height: 500px" })
.Events(ev => ev.DataBound("db"))
.Filterable()
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.StudentId).Editable(false);
model.Field(p => p.Name).Editable(false);
model.Field(p => p.MarkStructureId).Editable().Editable(false);
})
.Read(read => read.Action("StudentMarks_Read2", "StudentMarks", Model))
//.Update("StudentMark_Update", "StudentMarks")
.Update(update => update.Action("StudentMark_Update", "StudentMarks"))
)
)