Back to Devexpress

Table.BeginUpdate() Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-table.md

latest5.6 KB
Original Source

Table.BeginUpdate() Method

Locks the Table object. Prevents visual updates until the EndUpdate method calls.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
void BeginUpdate()
vb
Sub BeginUpdate

Remarks

Use the BeginUpdate and EndUpdate methods to avoid flickering during batch modifications to the Table‘s settings. After calling BeginUpdate, any changes to the Table‘s settings do not cause immediate repainting. This allows multiple changes without affecting performance or causing screen flickering. Once you finish all desired changes, call EndUpdate.

The BeginUpdate and EndUpdate methods use an internal counter to manage updates. The counter starts at 0. When the counter is above 0, the system blocks visual updates. When the counter returns to 0, the system allows updates. The BeginUpdate method increments the counter. The EndUpdate method decrements the counter. If the counter reaches 0, an immediate visual update occurs.

Always pair each BeginUpdate call with an EndUpdate call. To ensure EndUpdate runs even if an exception occurs, use the try...finally statement.

The following code snippets (auto-collected from DevExpress Examples) contain references to the BeginUpdate() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Table.cs#L24

csharp
{
    tbl.BeginUpdate();
    foreach (FileInfo fi in dirinfo.GetFiles())

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/TableActions.cs#L28

csharp
{
    tbl.BeginUpdate();
    foreach (FileInfo fi in dirinfo.GetFiles())

winforms-richedit-tables-simple-example/CS/TablesSimpleExample/Form1.cs#L51

csharp
{
    table.BeginUpdate();

word-document-api-examples/CS/CodeExamples/TablesActions.cs#L115

csharp
// Start to modify the table.
table.BeginUpdate();

word-document-api-table-examples/CS/Program.cs#L71

csharp
Table table = document.Tables[0];
table.BeginUpdate();

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Table.vb#L22

vb
Try
    tbl.BeginUpdate()
    For Each fi As System.IO.FileInfo In dirinfo.GetFiles()

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/TableActions.vb#L24

vb
Try
    tbl.BeginUpdate()
    For Each fi As FileInfo In dirinfo.GetFiles()

winforms-richedit-tables-simple-example/VB/TablesSimpleExample/Form1.vb#L44

vb
Private Sub mergeBtn_ItemClick(ByVal sender As Object, ByVal e As ItemClickEventArgs)
    table.BeginUpdate()
    ' Split cell into 8

word-document-api-examples/VB/CodeExamples/TablesActions.vb#L48

vb
' Start to modify the table.
tbl.BeginUpdate()
' Obtain the file list from the specified directory

word-document-api-table-examples/VB/Program.vb#L56

vb
Dim table As Table = document.Tables(0)
table.BeginUpdate()
'Split cell into 8

See Also

EndUpdate()

Table Interface

Table Members

DevExpress.XtraRichEdit.API.Native Namespace