Skip to main content

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

How to: Update a Layout Item and its Control

Consider an example where a layout item contains a ProgressBarControl and the ProgressBarControl’s position is displayed within the item’s text region. The ProgressBarControl is used to display the progress of a lengthy operation. The layout item and the control must be manually updated during the operation after each progress step. Otherwise, they will only be updated after the operation is completed. To update the layout item and the control it contains, the BaseLayoutItem.Update method is called.

using System.Threading;

for (int i = 0; i < 1000; i++) {                
    layoutControlItem1.Text = i.ToString();
    progressBarControl1.Position = i;
    // Update the layout item and its control.
    layoutControlItem1.Update();
    // Imitate a lengthy operation.
    Thread.Sleep(100); 
    //...
}