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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Importing a datatable to a sheet - View not getting updated.

Thread ID:





117328 Sep 29,2014 08:22 AM UTC Oct 10,2014 10:52 AM UTC WPF 1
Tags: SpreadsheetControl(Classic)
Asked On September 29, 2014 08:22 AM UTC

Hi . 

I'm using SpreadsheetControl in my application. 

I have to import a datatable to Worksheet ( the sheet can be anything that the user selects ) .

            SpreadsheetControl mySpeadsheetControl = Application.Current.MainWindow.FindName("mySpreadsheet") as SpreadsheetControl;
            IWorksheet sheet = mySpeadsheetControl.ExcelProperties.WorkBook.ActiveSheet;
            sheet.ImportDataTable(myGridContents, true, 1, 1);

When I do like this, the view is not getting updated. But if I click on some other sheet and then come back to this original sheet the view will be updated. How can i resolve this ? 

If I use the following method instead of  "sheet.ImportDataTable(myGridContents, true, 1, 1);"  
the view is getting updated immediately. But the problem with this is, whatever sheet I select , the changes happen only in Sheet1. Let me know if there is ant solution for this . 

Thanks in advance. 

Balakrishnan P [Syncfusion]
Replied On October 10, 2014 10:52 AM UTC

Hi Stephly,

Thanks for contacting Syncfusion support.

You can achieve your requirement "view updated immediately when loading the data table" by using invalidatecells() and invalidatevisuals() method. Please find the below code snippet for your reference.

Code Snippet:



Please let us know if you have any queries.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon