Programmatically scroll to the current select cell

Posted by: rlescano on 20 December 2017, 1:58 pm EST

  • Posted 20 December 2017, 1:58 pm EST

    Hello,

    is there a way to change the current active cell and also scroll inside the spreadsheet to the cell that is active?

    Scenario:

    1. current active cell is A1
    2. change the current active cell using:

      spreadsheet.workbook.getActiveSheet().setActiveCell(99,5)

      current active change to F100
    3. At this point I can’t see the current active cell and I need to scroll down to find the F100.

    So, is there a way I can not only change the current active cell but also scroll automatically until the current active cell (F100) is shown.

    Regards

    Román

  • Posted 20 December 2017, 2:07 pm EST

    Nevermind showCell is the function I was looking for.

  • Posted 21 December 2017, 3:17 am EST

    Hello,

    That is correct, after setting the activecell you need to call the showcell method to get the active cell in view. You can set the Vertical and Horizontal position of active cell.

    http://help.grapecity.com/spread/SpreadSheets11/webframe.html#SpreadJS~GC.Spread.Sheets.Worksheet~showCell.html

    Thanks,

    Deepak Sharma

  • Posted 29 August 2022, 3:45 am EST

    Hello @Deepak Sharma,

    Moves the view of a cell to the specified position in the “viewport” only right?

    How to navigate to a cell which is not in the viewport?

  • Posted 1 September 2022, 2:34 am EST

    HI,

    Please refer to the following link where we have a similar discussion.

    https://www.grapecity.com/forums/spreadjs/how-to-select-a-specific-c

    Regards,

    Avinash

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels