Simple grid using version 2012.2.831 in MVC 4:
@(Html.Kendo().Grid<SurveyTracker.Models.TimelineGrid>()
.Name("TimelineGrid")
.Columns(columns =>
{
columns.Bound(p => p.BeginDate).Format("{0:MM/dd/yyyy}").EditorTemplateName("Date");
columns.Bound(p => p.EndDate).Format("{0:MM/dd/yyyy}").EditorTemplateName("Date");
})
.DataSource(source => source
.Ajax()
.ServerOperation(false)
.Model(model => model.Id(x => x.Id))
.Read(x => x.Action("GetTimelines", "Home").Data("filterTimelines"))
)
.Pageable()
.Selectable(x => x.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
.Navigatable()
.Events(x => x.Change("selectTimeline"))
)
Three issues:
1) The grid is not selectable unless it has the .Navigatable() option specified. The demo doesn't mention that.
2) Biggest issue: Selecting a row doesn't fire the change event.
3) It selects the cell instead of the row.
Any ideas on why this is happening? It's pretty close to the demo code under Grid/Events for MVC.
@(Html.Kendo().Grid<SurveyTracker.Models.TimelineGrid>()
.Name("TimelineGrid")
.Columns(columns =>
{
columns.Bound(p => p.BeginDate).Format("{0:MM/dd/yyyy}").EditorTemplateName("Date");
columns.Bound(p => p.EndDate).Format("{0:MM/dd/yyyy}").EditorTemplateName("Date");
})
.DataSource(source => source
.Ajax()
.ServerOperation(false)
.Model(model => model.Id(x => x.Id))
.Read(x => x.Action("GetTimelines", "Home").Data("filterTimelines"))
)
.Pageable()
.Selectable(x => x.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
.Navigatable()
.Events(x => x.Change("selectTimeline"))
)
Three issues:
1) The grid is not selectable unless it has the .Navigatable() option specified. The demo doesn't mention that.
2) Biggest issue: Selecting a row doesn't fire the change event.
3) It selects the cell instead of the row.
Any ideas on why this is happening? It's pretty close to the demo code under Grid/Events for MVC.