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 Set a ActiveWorksheet ?

Thread ID:

Created:

Updated:

Platform:

Replies:

129005 Feb 21,2017 04:38 AM Feb 22,2017 08:06 AM WPF 3
loading
Tags: XlsIO
Devid
Asked On February 21, 2017 04:38 AM

I want to write this with the SyncFusion library:

        private Workbook ActiveWorkbook
        {
            get
            {
                return this.activeWorkbook;
            }
            set
            {
                this.activeWorkbook = value;
            }
        }

        private Worksheet ActiveWorksheet
        {
            get
            {
                return this.ActiveWorkbook.ActiveWorksheet;
            }
            set
            {
                this.ActiveWorkbook.ActiveWorksheet = value;
            }
        }

How can I achive the same with SyncFusion library ?


Devid
Replied On February 21, 2017 04:40 AM

The problem I have is that ActiveWorkbook.ActiveSheet is a read only property in SyncFusion

Devid
Replied On February 21, 2017 05:21 AM

I think this would be the solution. But ActiveSheet should not be actually Read Only in my opinion, but anyway.

 private IWorksheet ActiveWorksheet
        {
            get { return this.ActiveWorkbook.ActiveSheet; }
            set { this.SelectSheet(value); }
        }

 private void SelectSheet(IWorksheet value)
        {
            if (value != null)
            {
                SelectSheet(value.Index);
            }
        }

Sridhar Sukumar [Syncfusion]
Replied On February 22, 2017 08:06 AM

Hi Devid, 
 
Thank you for contacting Syncfusion support. 
 
We regret to let you know that ActiveSheet property cannot be changed as Read and Write property in XlsIO. However, you can achieve your requirement using the following code example in XlsIO. 
 
Code snippet: 
 private Worksheet ActiveWorksheet 
        { 
            get 
            { 
                return this.ActiveWorkbook.ActiveWorksheet; 
            } 
            set 
            { 
               value.Activate(); 
            } 
        } 
 
To know more about activating a worksheet refer the below documentation link.

Documentation Link: https://help.syncfusion.com/cr/cref_files/file-formats/xlsio/Syncfusion.XlsIO.Base~Syncfusion.XlsIO.ITabSheet~Activate.html

Regards,
 
Sridhar S. 


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.

;