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.

Refresh sheets

Thread ID:

Created:

Updated:

Platform:

Replies:

124812 Jun 30,2016 10:48 PM Jul 5,2016 05:13 AM WPF 3
loading
Tags: SfSpreadsheet
ray
Asked On June 30, 2016 10:48 PM

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 06:49 AM

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 11:48 AM

Thanks!

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

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.

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.

;