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. Image for the cookie policy date
close icon

SpreadsheetControl in WPF takes 2-3 seconds to initialize

We want to use it to preview excel files in our application. Unfortunately, if we create control dynamically it takes about 2-3 seconds to create and UI is stuck, because we have to use the same thread.

You can easily test it:
            Stopwatch sw = new Stopwatch();
            sw.Start();
            SpreadsheetControl c = new SpreadsheetControl();
            MessageBox.Show(sw.ElapsedMilliseconds.ToString());

Is there any way to make it faster?

We can create a control at the startup time, but this will increase startup time to 2-3 seconds. Our project is a Word add-in and initialization happens when user clicks button in ribbon, so such a big delay is unacceptable.


6 Replies

KB Kanimozhi Bharathi Syncfusion Team September 14, 2015 04:41 PM UTC

Hi Belikov,
Thank you for contacting Syncfusion Support.
We recommend you to use the new control SfSpreadsheet for high performance and better stability. Since we moved the old Spreadsheet Control to Classic.
The SfSpreadsheet is an Excel inspired control that allows you to create, edit, view and format the Microsoft excel files without Excel installed. It provides absolute ease of use UI experience with integrated ribbon.
Please find the attached sample which satisfies your requirement which takes less than 1 sec for loading the UI.
Sample link: http://www.syncfusion.com/downloads/support/forum/120238/ze/CS672036849
UG Link: http://www.syncfusion.com/downloads/support/forum/120238/ze/Spreadsheet-1173131472
Please let us know if you have any query.
Thanks
Kanimozhi B


BE Belikov September 15, 2015 07:04 AM UTC

Does this control allows copying of the cells and, if it does, do the cells copy together with the formulas?
Can ribbon be hidden? We use this control to quickly preview a document and copy data from there.


BE Belikov September 16, 2015 08:32 AM UTC

I tested SfSpreasheet. It is a bit faster, but still rather slow.
Another issue is that sometimes it throws System.Collections.Generic.KeyNotFoundException when I try to open the document. It happens with the same simple document (attached), so it is not related to document somehow.

Attachment: Test_de20936f.zip


KB Kanimozhi Bharathi Syncfusion Team September 16, 2015 11:34 AM UTC

Hi Belikov,

Please find the details below,



QUERY
RESPONSE
Does this control allows copying of the cells and, if it does, do the cells copy together with the formulas?
Can ribbon be hidden? We use this control to quickly preview a document and copy data from there.

We have analyzed your query. SfSpreadsheet allows you to copy the data along with formulas and you can also create SfSpreadsheet control separately without using SfSpreadsheet Ribbon.
it throws System.Collections.Generic.KeyNotFoundException when I try to open the document. It happens with the same simple document (attached), so it is not related to document somehow.

We are unable to reproduce the issue while importing the attached excel file with our sample. Can you please modify the sample to reproduce the issue along with the replication procedure? You can download the sample from the link below:

Link:

http://www.syncfusion.com/downloads/support/forum/120238/ze/CS_(2)-220613842

Please
 provide us the stack trace details of the issue to analyze further and provide a better solution.




Please let us know if you have any other query.

Thanks
Kanimozhi B




BE Belikov September 16, 2015 11:36 AM UTC

I found what caused System.Collections.Generic.KeyNotFoundException. 
It happen when I try to create control and open document immediately in the same method. It seems that it need some time to initialize...


JG Jai Ganesh S Syncfusion Team September 17, 2015 10:08 AM UTC

Hi Belikov,


We are able to reproduce the issue and a support incident to track the status of this query has been created under your account. Please log on to our support website to check for further updates


https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents


Please let me know if you have any questions.


Thank you,

Jai Ganesh S


Loader.
Live Chat Icon For mobile
Up arrow icon