How to get the cells' value of the selected range?

8 posts, 0 answers
  1. ltxx
    ltxx avatar
    11 posts
    Member since:
    Oct 2015

    Posted 19 Nov 2015 Link to this post

    How to get the cells' value of the selected range? please give the example, thanks!
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 20 Nov 2015 Link to this post

    Hi,

    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
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. ltxx
    ltxx avatar
    11 posts
    Member since:
    Oct 2015

    Posted 23 Nov 2015 in reply to Alexander Popov Link to this post

    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?

  5. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 25 Nov 2015 Link to this post

    Hello,

    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
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. ltxx
    ltxx avatar
    11 posts
    Member since:
    Oct 2015

    Posted 25 Nov 2015 in reply to Alexander Popov Link to this post

    Alexander Popov said:Hello,

    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
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     

    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(); 

  7. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 27 Nov 2015 Link to this post

    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
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  8. chandan
    chandan avatar
    5 posts
    Member since:
    Sep 2016

    Posted 04 Oct Link to this post

    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
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
    How to customise row and column header in kendo spreadsheet 

    Is there any Cell template is available for kendo spreadsheet

  9. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 06 Oct Link to this post

    Hello chandan,

    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
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready