At first,My grid is defined like this,I click the search buttton and then the grid read the data and group by class.
@(Html.Kendo().Grid<Student>()
.Name("StudentGrid")
.Scrollable()
.Columns(columns =>
{
columns.Bound(o => o.Class).Groupable(true).Title("Class");
columns.Bound(o => o.Name).Groupable(true).Title("Name");
columns.Bound(o => o.Point).Groupable(true).Title("Point");
}).AutoBind(false)
.DataSource(dataSource => dataSource
.Ajax().Group(i => i.Add(a => a.Class))
.Read(read => read.Action("GetStudentPoint", "StudentControl"))
.Events(events => events.Error("error_handler"))
))
Now I want to make the gird groupable false and hide the class column,meas I do not want to group the student data and hide class column ,What's wrong with my code?
$("#StudentGrid").data("kendoGrid").Groupable( false );
$("#StudentGrid").data("kendoGrid").hideColumn(0);
$("#StudentGrid").data("kendoGrid").dataSource.read();
@(Html.Kendo().Grid<Student>()
.Name("StudentGrid")
.Scrollable()
.Columns(columns =>
{
columns.Bound(o => o.Class).Groupable(true).Title("Class");
columns.Bound(o => o.Name).Groupable(true).Title("Name");
columns.Bound(o => o.Point).Groupable(true).Title("Point");
}).AutoBind(false)
.DataSource(dataSource => dataSource
.Ajax().Group(i => i.Add(a => a.Class))
.Read(read => read.Action("GetStudentPoint", "StudentControl"))
.Events(events => events.Error("error_handler"))
))
Now I want to make the gird groupable false and hide the class column,meas I do not want to group the student data and hide class column ,What's wrong with my code?
$("#StudentGrid").data("kendoGrid").Groupable( false );
$("#StudentGrid").data("kendoGrid").hideColumn(0);
$("#StudentGrid").data("kendoGrid").dataSource.read();