select

Gets or sets the table rows (or cells) which are selected.

If the Grid is using frozen (locked) columns and multiple cell selection with string selector, the select method will select and return two table cell elements. This is because the frozen columns feature works with the separate tables for the frozen and non-frozen columns. Each cell element corresponds to the jQuery selector applied for each table. One of the table cells will be a descendant of div.k-grid-content-locked and the other one will be a descendant of div.k-grid-content. The two divs are siblings in the Grid DOM structure. To select just one table cell please use jQuery selector to find the exact one cell from the specific table element and set k-state-selected class instead of using the select method.

Parameters

rows String|Element|jQuery

A string, DOM element or jQuery object which represents the table row(s) or cell(s). A string is treated as a jQuery selector.

Returns

jQuery the selected table rows or cells.

In case of using frozen (locked) columns and row selection, the select method will return two table row elements for each selected item. Each pair of table row elements that correspond to the same data item, will have the same data-uid attribute value. One of the table rows will be a descendant of div.k-grid-content-locked and the other one will be a descendant of div.k-grid-content.

Example - select the first and second table rows

<div id="grid"></div>
<script>
  $("#grid").kendoGrid({
    columns: [
      { field: "name" },
      { field: "age" }
    ],
    dataSource: [
      { name: "Jane Doe", age: 30 },
      { name: "John Doe", age: 33 }
    ],
    selectable: "multiple, row"
  });
  var grid = $("#grid").data("kendoGrid");
  grid.select("tr:eq(0), tr:eq(1)");
</script>
In this article
Not finding the help you need?