SpreadsheetGear
EndUpdate Method
See Also  Example Send Feedback
SpreadsheetGear Namespace > IWorkbookSet Interface : EndUpdate Method

Restores painting and events to the state they were in before the last call to BeginUpdate, releases the lock acquired by BeginUpdate, and starts background calculation if appropriate.

Syntax

Visual Basic (Declaration) 
Sub EndUpdate() 
C# 
void EndUpdate()

Example

Demonstrate using a workbook set in a thread safe manner when accessing the SpreadsheetGear API many times.
C#Copy Code
void DoSomeThreadSafeWorkQuickly(IWorkbookSet workbookSet)
       {
           
// Interrupt background calculation if necessary, acquire an
           
// exclusive lock on the workbook set and suspend events and
           
// painting.
           
workbookSet.BeginUpdate();

           
try {
               
// Do a lot of work...
           }
           
finally {
               
// Release the lock on the workbook set, start background
               
// calculation if appropriate and repaint controls.
               
workbookSet.EndUpdate();
           }
       }
    
Visual BasicCopy Code
Sub DoSomeThreadSafeWorkQuickly(ByVal workbookSet As IWorkbookSet)
            ' Interrupt background calculation if necessary, acquire an
            ' exclusive lock on the workbook set and suspend events and
            ' painting.
            workbookSet.BeginUpdate()

            Try
                ' Do a lot of work...
            Finally
                ' Release the lock on the workbook set, start background
                ' calculation if appropriate and repaint controls.
                workbookSet.EndUpdate()
            End Try
        End Sub 'DoSomeThreadSafeWork

Remarks

This method is thread safe.

EndUpdate releases the lock which was acquired by BeginUpdate by calling GetLock.

See GetLock and ReleaseLock for more information about acquiring and releasing locks and the effect this has on background calculation.

Requirements

Platforms: x86 and x64 versions of Windows 2000, Windows XP, Windows Vista, Windows 7, Windows Server 2003 (including R2) and Windows Server 2008 (including R2). SpreadsheetGear 2009 requires the Microsoft .NET Framework 2.0 and supports .NET 3.0 and .NET 3.5.

See Also

Copyright © 2003-2009 SpreadsheetGear LLC. All Rights Reserved.Help Powered by Innovasys   
SpreadsheetGear is a registered trademark of SpreadsheetGear LLC.
Microsoft, Microsoft Excel and Visual Studio are trademarks or registered trademarks of Microsoft Corporation.