How to enable multiple row selection programmatically

3 posts, 0 answers
  1. Rui
    Rui avatar
    17 posts
    Member since:
    Jun 2017

    Posted 27 Jul 2017 Link to this post

    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. Preslav
    Admin
    Preslav avatar
    591 posts

    Posted 27 Jul 2017 Link to this post

    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.
  3. Rui
    Rui avatar
    17 posts
    Member since:
    Jun 2017

    Posted 28 Jul 2017 Link to this post

    That's exactly it. Thank you.
Back to Top