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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Refresh sheets

Thread ID:

Created:

Updated:

Platform:

Replies:

124812 Jul 1,2016 02:48 AM UTC Jul 5,2016 09:13 AM UTC WPF 3
loading
Tags: SfSpreadsheet
ray
Asked On July 1, 2016 02:48 AM UTC

In sfSpreadsheet ,I load the excel template and set data  in code,.it has two sheets.How to refresh all sheets in sfSpreadsheet ,spreadsheet.ActiveGrid.InvalidateCells() seems only refresh the active grid.

Kanimozhi Bharathi [Syncfusion]
Replied On July 1, 2016 10:49 AM UTC

Hi Ray,   
   
You can access each SpreadsheetGrid in SfSpreadsheet by invoking the WorkbookLoaded Event  or by  passing the worksheet name in  GridCollection Property  and call the  InvalidateCells method to refresh the view.   
   
Please find the code example for your reference,   
   
spreadsheet.WorkbookLoaded += spreadsheet_WorkbookLoaded;   
   
void spreadsheet_WorkbookLoaded(object sender, WorkbookLoadedEventArgs args)   
{    
   foreach (var grid in args.GridCollection)   
   {   
     grid. InvalidateCells();   
   }   
   
}   
   
OR   
   
var sheet1 = spreadsheet.Workbook.Worksheets[0];   
var sheet2=  spreadsheet.Workbook.Worksheets[1];   
spreadsheet.GridCollection[sheet1.Name].InvalidateCells();   
spreadsheet.GridCollection[sheet2.Name].InvalidateCells();   
   
  
   
   
You can also refer the below UG links to access each grid and refreshing the view,   
   
   
   
Regards   
Kanimozhi B   


ray
Replied On July 4, 2016 03:48 PM UTC

Thanks!

Kanimozhi Bharathi [Syncfusion]
Replied On July 5, 2016 09:13 AM UTC

Hi Ray, 
Thank you for your update. 
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.

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

;