This is a migrated thread and some comments may be shown as answers.

How to make the gird groupable false in js?

1 Answer 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vae
Top achievements
Rank 1
vae asked on 24 Sep 2013, 06:57 PM
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();

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 25 Sep 2013, 08:50 AM
Hello,

 Disabling grouping from JavaScript isn't supported out of the box. You can try destroying the grid first and then creating it again. Here is a live demo: http://jsbin.com/aQiqICa/1/edit

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
vae
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or