ComponentOne FlexPivot for WinForms
C1.Win.C1FlexGrid.4.5.2 Assembly / C1.Win.C1FlexGrid Namespace / C1FlexGrid Class / DeferUpdate Method

In This Topic
    DeferUpdate Method (C1FlexGrid)
    In This Topic
    Suspends notifications until the returned System.IDisposable object is disposed.
    Syntax
    'Declaration
     
    Public Function DeferUpdate() As IDisposable
    public IDisposable DeferUpdate()

    Return Value

    An System.IDisposable object that must be disposed to restore notifications.
    Remarks
    This method is typically used in update blocks to perform batch updates efficiently and safely.
    Example

    The example below shows how you can use the DeferUpdate method to suspend notifications while setting the width of several columns.

    Note that the call to the DeferUpdate method is placed in a using statement, which automatically disposes of the object and restores updates at the end of the block, even if the code within the block throws an exception. This makes the code more readable and concise than calling the more traditional BeginUpdate and EndUpdate methods within a try/finally block.

    See Also