Skip to main content
All docs
V22.2

CRXPF0013 - Missing EndUpdate call

Severity: Warning

The analyzer detects that you call the control collection’s BeginUpdate method and do not call the subsequent EndUpdate method. In this case, the control’s UI remains locked.

Examples

Invalid Code

_gridControl.Columns.BeginUpdate();
for ... || foreach ... || while ... || any cycle
    _gridControl.Columns.Add(_newColumn);

// OR

_gridControl.Columns.BeginUpdate();
_gridControl.Columns.Add(_newColumn1);
_gridControl.Columns.Add(_newColumn2);
_gridControl.Columns.Remove(_someColumn);

Valid Code

_gridControl.Columns.BeginUpdate();
for ... || foreach ... || while ... || any cycle
    _gridControl.Columns.Add(_newColumn);
_gridControl.Columns.EndUpdate();

// OR

_gridControl.Columns.BeginUpdate();
_gridControl.Columns.Add(_newColumn1);
_gridControl.Columns.Add(_newColumn2);
_gridControl.Columns.Remove(_someColumn);
_gridControl.Columns.EndUpdate();

How to Fix

Call the EndUpdate method after collection updates to unlock the control’s UI.