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

Auto Refresh Radgrid only when data is update

1 Answer 194 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
elad
Top achievements
Rank 1
elad asked on 24 Dec 2013, 04:01 PM
Hi

i implemented the solution here :
Ajaxify Timer

but every 1 sec the timer component is sending request to the server and back with all the data.
what i want is to check if there is new data in the DB , if so, refresh the RadGrid 

in the timer event i do so : 
  protected void Timer1_Tick(object sender, EventArgs e)
    {
        DateTime date;
        if (DateTime.TryParse(SessionState.SessionSusitaLeadsLastCheck, out date)) // Last checking date
        {
            if (SmartAgentServices.GetInstance().CheckLastSmartAgentRequest(date)) // Check if add new data
            {
                RadGrid1.Rebind();
            }
        }
        SessionState.SessionSusitaLeadsLastCheck = DateTime.Now.ToString(); //update the last checking date
    }
thanks

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 25 Dec 2013, 07:45 AM
Hello Elad,

Basically, your approach is correct. Can you please elaborate on what the actual problem is? Have you tried to debug your code to see whether the conditions are met correctly?

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Ajax
Asked by
elad
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or