7 Answers, 1 is accepted
The first step would be to create a Range using the sheet's current selection. Once you have that you can extract the Range's cell values, for example:
var
sheet = spreadsheet.activeSheet();
var
range = sheet.selection();
var
values = range.values();
Regards,
Alexander Popov
Telerik
Thanks for your help! I have an another question.
Given the number of rows and columns, how can I get the selection "range"? because the column No is 'A','B',.....
Now, I can get the selection range by using:
1.
sheet.range(
"A1:B3"
)
Is there a function for getting the selection range directely,given the number of rows and columns?
As stated in the documentation, the range method also supports the RC notation, where both the row and the column can be referred by numbers.
Regards,
Alexander Popov
Telerik
As stated in the documentation, the range method also supports the RC notation, where both the row and the column can be referred by numbers.
Regards,
Alexander Popov
Telerik
[/quote]
Hi,
As you say, the range method of the spreadsheet support RC notation, however it seems not to be working as my expected. Can you give an example for me? My code is as follows:
var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
var sheet = spreadsheet.activeSheet();
var range = sheet.range("R4C5"); //4 rows and 5 columns,A1:E4
//var range = sheet.range("A1:E4"); //OK
var values = range.values();
I apologize for misleading you. Indeed, the RC notation is currently not working as expected, which is something we will investigate. Meanwhile you can use the range method by passing the starting row and column, as well as the desired number of rows and column to be included. For example:
//create a range between A1 and E4:
var
startingRow = 0;
//zero-based
var
startingCol = 0;
var
rows = 4;
var
cols = 5;
var
range = spreadsheet.activeSheet().range(startingRow, startingCol, rows, cols);
spreadsheet.activeSheet().select(range._ref);
Regards,
Alexander Popov
Telerik
[quote]Alexander Popov said:Hello,
I apologize for misleading you. Indeed, the RC notation is currently not working as expected, which is something we will investigate. Meanwhile you can use the range method by passing the starting row and column, as well as the desired number of rows and column to be included. For example:
//create a range between A1 and E4:
var
startingRow = 0;
//zero-based
var
startingCol = 0;
var
rows = 4;
var
cols = 5;
var
range = spreadsheet.activeSheet().range(startingRow, startingCol, rows, cols);
spreadsheet.activeSheet().select(range._ref);
Regards,
Alexander Popov
Telerik
Is there any Cell template is available for kendo spreadsheet
I am afraid customizing the the Spreadsheet's column and row headers is not supported by design, thus the lack of any templates.
Regards,
Alexander Popov
Telerik by Progress