This is a migrated thread and some comments may be shown as answers.

Jump to active cell in UI?

2 Answers 42 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Soulstorm
Top achievements
Rank 1
Soulstorm asked on 08 Feb 2016, 01:02 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 10 Feb 2016, 09:03 AM
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
0
Soulstorm
Top achievements
Rank 1
answered on 10 Feb 2016, 11:29 AM
Thanks a lot! It works great!
Tags
Spreadsheet
Asked by
Soulstorm
Top achievements
Rank 1
Answers by
Todor
Telerik team
Soulstorm
Top achievements
Rank 1
Share this question
or