The BeginUpdate and EndUpdate methods are used to optimize the performance of the grid. Call BeginUpdate before making extensive changes, and call 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.
使用例
The code below shows how to add a large number of rows to the grid efficiently. Note how the EndUpdate method is called inside a 'finally' block to ensure repainting is properly restored.