Auto Refresh Radgrid only when data is update

2 posts, 0 answers
  1. elad
    elad avatar
    1 posts
    Member since:
    May 2011

    Posted 24 Dec 2013 Link to this post

    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
  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 25 Dec 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top