ComponentOne FlexPivot for WinForms
C1.Win.FlexPivot.4.5.2 Assembly / C1.Win.FlexPivot Namespace / C1FlexPivotGrid Class / BeginUpdate Method

In This Topic
    BeginUpdate Method (C1FlexPivotGrid)
    In This Topic
    Maintains performance by preventing the control from updating itself until the C1.Win.C1FlexGrid.C1FlexGridBase.EndUpdate method is called.
    Syntax
    'Declaration
     
    Public Overridable Sub BeginUpdate() 
    public virtual void BeginUpdate()
    Remarks
    The C1.Win.C1FlexGrid.C1FlexGridBase.BeginUpdate and C1.Win.C1FlexGrid.C1FlexGridBase.EndUpdate methods are used to optimize the performance of the grid. Call C1.Win.C1FlexGrid.C1FlexGridBase.BeginUpdate before making extensive changes, and call C1.Win.C1FlexGrid.C1FlexGridBase.EndUpdate when done to suspend repainting. This will reduce flicker and increase performance. This optimization is especially effective when adding large numbers of rows to the grid, because it needs to recalculate ranges and update scrollbars each time a row is added.
    Example
    The code below shows how to add a large number of rows to the grid efficiently. Note how the C1.Win.C1FlexGrid.C1FlexGridBase.EndUpdate method is called inside a 'finally' block to ensure repainting is properly restored.
    See Also