We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to change the displayed worksheet programmatically?

Thread ID:

Created:

Updated:

Platform:

Replies:

123824 Apr 25,2016 04:18 AM Apr 26,2016 08:37 AM WPF 1
loading
Tags: SfSpreadsheet
Michael Topf
Asked On April 25, 2016 04:18 AM

Hi,

I have an application with the sfspreadsheetcontrol. I load an excel-file with multiple worksheets. The active sheet at start is the firsdt worksheet which is also displayed in the control. Now I need to switch by code to another worksheet, so that the user sees those new worksheet (e.g. because as a result of a search, I know that the wanted cell is on sheet 2).

I can change the active sheet:  spreadsheetControl.ActiveSheet = spreadsheetControl.Workbook.Worksheets[worksheetname];

Now the active sheet has changed, but still the old worksheet is displayed by the control. I have tried something like: spreadsheetControl.ActiveSheet.Activate();

But the old worksheet is still active.

So what do I need to change, worksheet?

Thanks,
Michael

Kanimozhi Bharathi [Syncfusion]
Replied On April 26, 2016 08:37 AM

Hi Michael, 

Thank you for contacting Syncfusion Support. 

We have added a new method “SetActiveSheet(“SheetName”) to set the active worksheet in SfSpreadsheet  and this method will be included in 2016Vol1 SP1 release which will be rolled out by the end of this month. 

if (this.Spreadsheet.SetActiveSheet("Sheet10")) 
MessageBox.Show("Sheet activated"); 


Regards 
Kanimozhi B 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;