or
<%: Html.Kendo().Grid<
TSAEMSV3.Models.AirportTrainingViewManagementModel
>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(x => x.Record).Width(65);
columns.Bound(x => x.Code).Width(65);
columns.Bound(x => x.PeopleTrained).Width(100);
columns.Bound(x => x.TrainingTypes).Width(100);
columns.Bound(x => x.Trainer).Width(100);
columns.Bound(x => x.TrainingDate).Format("{0:MM/dd/yyyy}").Width(100);
}
)
.ToolBar(toolbar =>
{
toolbar.Template(() =>
{ %>
<
div
class
=
"toolbar"
>
<
label
class
=
"category-label"
for
=
"category"
>Show products by category:</
label
>
</
div
>
<%});
})
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:500px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(50)
.Read(read => read.Action("RetrieveTrainingManagementGrid", "AirportTraining"))
);
%>
@(Html.Kendo().Grid<
VideoGames.Game
>(Model)
.Name("theGrid")
.Columns(c =>
{
c.Bound(p => p.Name).Width(200);
c.Bound(p => p.Price).Format("{0:c}").Width(100);
c.Bound(p => p.Genre).Width(100);
c.Bound(p => p.ImageUrl).ClientTemplate("<
img
src
=
'#= ImageUrl #'
alt
=
''
/>").Width(150);
c.Command(cmd => { cmd.Edit(); });
})
.Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InCell))
.Pageable()
.ToolBar(c => c.Save())
.DataSource(d => d.Ajax()
.Model(m => m.Id(p => p.Name))
.Update(c => c.Action("UpdateGame", "Home")))
)
$(
"#theGrid"
).kendoGrid({
dataSource: {
data: data,
batch:
true
,
schema: {
model: {
id:
"GameID"
,
fields: {
GameID: { editable:
false
, nullable:
true
},
Name:
"Name"
,
Price: { type:
"number"
},
ReleaseDate: { type:
"date"
},
Genre:
"Genre"
,
Rating:
"Rating"
,
}
}
}
},
transport: {
update: {
url:
"/home/updategame"
,
success: onUpdateSuccess,
error: onUpdateError
}
}
toolbar: [
"Save"
],
height: 400,
editable:
true
,
scrollable:
true
,
columns: [
{
field:
"Name"
,
title:
"Title"
},
{
field:
"Price"
,
title:
"Price"
,
format:
'{0:c}'
},
{
field:
"ReleaseDate"
,
title:
"Rel Date"
,
template:
'#= kendo.toString(ReleaseDate,"MM/dd/yyyy") #'
},
{
field:
"Genre"
},
{
field:
"Rating"
},
],
});