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

Timer to Refesh Grid Data

1 Answer 257 Views
GridView
This is a migrated thread and some comments may be shown as answers.
bradley baker
Top achievements
Rank 1
bradley baker asked on 19 Mar 2010, 03:54 PM
Do I need to do anything other than below to refresh a gridview?  (Im talking about the TableAdapter.Fill, will this cause the grid to rebind to the data automatically or do I need to include that also?  (It currenly appears to be working when the timer is up it does seem to freeze up the app for a few seconds as it downloads the huge dataset but because there is so much data and it maybe 5-10min between a change its kind of hard for me to see if a change happens.

    Private Sub Timer1_Tick(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles Timer1.Tick  
        Dim Diff As TimeSpan = TargetTime.Subtract(Now)  
        If Diff.Seconds = 0 And Diff.Minutes = 0 Then 
            Label1.Text = "Data Refresh Now!  Stand By!" 
            Me.ExpediteTableAdapter.CommandTimeout = 0  
            Me.ExpediteTableAdapter.Fill(Me.MSQL_ERPLXFDataSet.Expedite)  
            TargetTime = Now.AddMinutes(30)  
        ElseIf Diff.Seconds < 0 And Diff.Minutes >= 0 Then 
            Label1.Text = "-" & Format(Diff.Minutes, "#0") & ":" & Format(System.Math.Abs(Diff.Seconds), "00")  
        Else 
            Label1.Text = "Data Refresh In " & Format(Diff.Minutes, "#0") & ":" & Format(System.Math.Abs(Diff.Seconds), "00")  
        End If 
    End Sub 

1 Answer, 1 is accepted

Sort by
0
Accepted
Julian Benkov
Telerik team
answered on 24 Mar 2010, 01:48 PM
Hello bradley baker,

The only operation needed for an update operation in a bound RadGridView in you case is calling Fill on the adapter. RadGridView handles the ListChanged event of the bound IBindingList object (in this case DataTable/DataView) and automatically refreshes its rendered data. 

Sincerely yours,
Julian Benkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
bradley baker
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or