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

How to enable multiple row selection programmatically

2 Answers 1240 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rui
Top achievements
Rank 1
Rui asked on 27 Jul 2017, 01:06 PM
Hi. I have this grid

 

@(Html.Kendo().Grid<Something>
          ()
          .Name("Something")
          .Selectable(builder => builder.Type(GridSelectionType.Row).Mode(GridSelectionMode.Multiple).Enabled(false) )
          .ClientRowTemplate(Html.Partial("Partials/Something").ToHtmlString())
          .TableHtmlAttributes(new { @class = "table table-stripped" })
          .Scrollable(scrollable => scrollable.Height(100).Enabled(true))
          .Columns(columns =>
          {
              columns.Bound(h => h.Something).Title("Partner type").Width(120);
              columns.Bound(h => h.Something).Title("Date").Width(120);
              columns.Bound(h => h.Something).Title("Name");
          }))

that has multiple row selection disabled.

This grid is populated when I select another grid. After that, I want to have multiple row selection enabled. I did set the grid.options.selectable to true, but it doesn't work.

How can I solve this?

 

 

 

 

 

 


2 Answers, 1 is accepted

Sort by
0
Preslav
Telerik team
answered on 27 Jul 2017, 02:57 PM
Hello Rui,

Achieving the desired behavior will require using the setOptions method of the Grid.
Select the grid via jQuery and invoke the setOptions. For example, the code might look like:

var grid = $("#myGridID").data("kendoGrid");
 
grid.setOptions({
  selectable: "multiple, row"
})

For a runnable example, check this Dojo: http://dojo.telerik.com/IMATa


Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Rui
Top achievements
Rank 1
answered on 28 Jul 2017, 07:50 AM
That's exactly it. Thank you.
Tags
Grid
Asked by
Rui
Top achievements
Rank 1
Answers by
Preslav
Telerik team
Rui
Top achievements
Rank 1
Share this question
or