Jump to active cell in UI?

3 posts, 1 answers
  1. Soulstorm
    Soulstorm avatar
    2 posts
    Member since:
    Oct 2015

    Posted 08 Feb Link to this post

    Hello everyone!

    Is there a way to scroll to active cell in UI from codebehind? My spreadsheet contains big amount of data and needs some sort of navigation.

  2. Answer
    Todor
    Admin
    Todor avatar
    168 posts

    Posted 10 Feb Link to this post

    Hello,

    You could use the RadWorksheetEditor's BringIntoView() method by passing the active cell index as the following code-snippet:
    CellIndex activeCellIndex = spreadsheet.ActiveWorksheetEditor.Selection.ActiveCellIndex;
    spreadsheet.ActiveWorksheetEditor.BringIntoView(activeCellIndex);

    In order you desire to set the active cell index as top left index, you could use the following code-snippet:
    CellIndex activeCellIndex = spreadsheet.ActiveWorksheetEditor.Selection.ActiveCellIndex;
    spreadsheet.ActiveWorksheetEditor.UpdateToViewWithTopLeftCellIndex(activeCellIndex);

    In addition, depending on your scenario, you could use the RadSpreadsheet's SetHorizontalOffset() and SetVerticalOffset() methods which offsets the viewport with a specific double value.

    I hope this helps.

    Regards,
    Todor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Soulstorm
    Soulstorm avatar
    2 posts
    Member since:
    Oct 2015

    Posted 10 Feb in reply to Todor Link to this post

    Thanks a lot! It works great!
Back to Top