I'm working on a project using MVC 3 and kendo controls. I have a Kendo grid that has set to have GridSelectionType.Row, and I can get the correct selected row index by using index() function.
Code in .cshtml:
.Selectable(selectable => selectable.Enabled(true).Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
Code in javascript file:
var grid = $('#MyGrid').data("kendoGrid");
var selectedRow = grid.select();
var selectedRowIndex = selectedRow.index();
I also have another Kendo grid and this grid has set to have Cell selection. I can get correct selected cell index by cellIndex() function, but I cannot get the correct selected row index by using index() function.
Code in .cshtml:
.Selectable(selectable => selectable.Enabled(true).Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Cell))
Code in javascript file:
var grid = $('#MyGrid').data("kendoGrid");
var selectedRow = grid.select();
var selectedRowIndex = selectedRow.index(); // incorrect selected row index returned
var selectedCellIndex = grid.cellIndex(grid.select()); // correct selected cell index returned
Please help. How can I get selected row index on Kendo grid if it is in cell selection type?
Thanks,
Code in .cshtml:
.Selectable(selectable => selectable.Enabled(true).Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Row))
Code in javascript file:
var grid = $('#MyGrid').data("kendoGrid");
var selectedRow = grid.select();
var selectedRowIndex = selectedRow.index();
I also have another Kendo grid and this grid has set to have Cell selection. I can get correct selected cell index by cellIndex() function, but I cannot get the correct selected row index by using index() function.
Code in .cshtml:
.Selectable(selectable => selectable.Enabled(true).Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Cell))
Code in javascript file:
var grid = $('#MyGrid').data("kendoGrid");
var selectedRow = grid.select();
var selectedRowIndex = selectedRow.index(); // incorrect selected row index returned
var selectedCellIndex = grid.cellIndex(grid.select()); // correct selected cell index returned
Please help. How can I get selected row index on Kendo grid if it is in cell selection type?
Thanks,