Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DXWIN0004: EndUpdate Missing

Severity: Warning

The BeginUpdate method locks a control and prevents any visual updates to this control, which allows you to apply a large number of changes without triggering excessive redraw commands. After all edits are applied, call the EndUpdate method to unlock the control.

#Example 1

#Invalid Code

C#
public void UpdateView(GridView view) {
    view.BeginUpdate();
    // Update operations
}

#Valid Code

C#
public void UpdateView(GridView view) {
    view.BeginUpdate();
    // Update operations
    view.EndUpdate();
}

#Example 2

#Invalid Code

C#
public void UpdateView(GridView view) {
    try {
        view.BeginUpdate();
        // Update operations
        view.EndUpdate(); // Not called if an exception occurs in the code above
        }
    catch { }
    finally { }
}

#Valid Code

C#
public void UpdateView(GridView view) {
    try {
        view.BeginUpdate();
        // Update operations
    }
    catch { }
    finally {
        view.EndUpdate(); // The EndUpdate method is always reachable
    }
}