New to Telerik UI for WinForms? Download free 30-day trial

Associated Control

RadWaitingBar allows you to associate it to any control indicating its load time.

Fig.1 Load indication

WinForms RadWaitingBar Load indication

The following tutorial demonstrates how to indicate the data loading operation in RadGridView.

Fig.2 Load data

WinForms RadWaitingBar Load data

  1. Add RadWaitingBar, RadGridView and RadButton to the form.
  2. Subscribe to the Click event of RadButton and set the RadWaitingBar.AssociatedControl property to the grid. Thus, the waiting bar will be displayed over the grid while data is loading. After the data is loaded, set the AssociatedControl property to null. Use the following code snippet:

Data loading

System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
private void radButton1_Click(object sender, EventArgs e)
{
    timer.Interval = 3000;
    timer.Tick += timer_Tick;
    this.radWaitingBar1.AssociatedControl=this.radGridView1;
    this.radWaitingBar1.StartWaiting();
    timer.Start();
}
private void timer_Tick(object sender, EventArgs e)
{
    timer.Stop();
    this.radWaitingBar1.AssociatedControl=null;
    this.radGridView1.DataSource = this.categoriesBindingSource;
}

Private timer As New System.Windows.Forms.Timer()
Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
    Timer.Interval = 3000
    AddHandler Timer.Tick, AddressOf timer_Tick
    Me.RadWaitingBar1.AssociatedControl = Me.RadGridView1
    Me.RadWaitingBar1.StartWaiting()
    Timer.Start()
End Sub
Private Sub timer_Tick(sender As Object, e As EventArgs)
    timer.[Stop]()
    Me.RadWaitingBar1.AssociatedControl = Nothing
    Me.radGridView1.DataSource = Me.categoriesBindingSource
End Sub

In this article