This is a migrated thread and some comments may be shown as answers.

Rebind with timer

2 Answers 159 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ghini
Top achievements
Rank 2
ghini asked on 10 Nov 2010, 10:43 AM
Hi all,
I have an ASPX page with RadGrid control.
I need to refresh the RadGrid every 5 seconds.

I tried with this:

Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
    If Not IsPostBack Then
        Dim aTimer As Timer = New Timer(2000)
        AddHandler aTimer.Elapsed, AddressOf timer_Elapsed
        aTimer.AutoReset = True
        aTimer.Enabled = True
    End If
End Sub

Private Sub timer_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs)
    RadGrid1.Rebind()
End Sub

but I received an "InvalidOperationException: Script controls may not be registered after PreRender".

Any suggestions?

Thanks to all




2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 10 Nov 2010, 10:57 AM
Hello,


I found a demo which shows how to use Timer to update grid content in regular interval. Have a look in this.
Grid / Server Binding


Another example demonstrates how to perform RadGrid client-side data-binding to visualize live data using web service.
Grid / Client Binding
 

-Shinu.
0
ghini
Top achievements
Rank 2
answered on 10 Nov 2010, 11:10 AM
Beautiful, quick and easy.
I resolved this issue using the Ajax Timer Control...

Thank you very much!
Tags
Grid
Asked by
ghini
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
ghini
Top achievements
Rank 2
Share this question
or