The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

Formatting.EndUpdate() Method

Unlocks the Formatting object after a call to the BeginUpdate method and causes an immediate visual update.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll

Declaration

void EndUpdate()
Sub
void EndUpdate()
Sub

Remarks

The BeginUpdate and EndUpdate methods allow you to avoid flickering while performing batch modifications to the Formatting's settings. Once the BeginUpdate method has been called, modifying the Formatting's settings does not result in immediate repainting. So, multiple modifications can be made to the object without a major impact on performance or screen flickering. After all the desired operations have been finished, call the EndUpdate method.

The BeginUpdate and EndUpdate methods use an internal counter to implement the update functionality. The counter's initial value is 0. Visual updates are forbidden if the counter's value is greater than 0, and the updates are enabled if the counter's value is 0. The BeginUpdate method increments the counter. The EndUpdate method decrements the counter. If the counter's new value is 0, an immediate visual update occurs. Each call to BeginUpdate must be paired with a call to EndUpdate. To ensure that EndUpdate is always called even if an exception occurs, use the try...finally statement.

Examples

  1. Access a style to be modified. To do this, get the corresponding Style object from the Workbook.Styles collection by the style name or index.
  2. Use the style's Formatting.BeginUpdate and Formatting.EndUpdate paired methods to modify the required format attributes of the style.
// Access the style to be modified.
Style customStyle = workbook.Styles["Custom Style"];

// Change the required formatting characteristics of the style.
customStyle.BeginUpdate();
try {
    customStyle.Fill.BackgroundColor = Color.Gold;
    // ...
} finally {
    customStyle.EndUpdate();
}
See Also