AJAX-refreshing progressArea in grid

2 posts, 0 answers
  1. Oscar
    Oscar avatar
    21 posts
    Member since:
    Sep 2008

    Posted 16 Jul 2012 Link to this post

    I have a progress monitoring screen with a radGrid that lists processes.
    One of the grid columns contains a progressArea that shows process progress (from 0 to 100%) (see attachment)
    To refresh the page I use the following


    Me.GetType(), "refresh", "window.setTimeout('window.location.reload(true)',10000);", True)

    This causes the entire page to reload every 10 seconds, which is annoying,  I want just the progressareas to refresh, but cannot find how.
    Thanks for any help

  2. Kostadin
    Kostadin avatar
    1733 posts

    Posted 18 Jul 2012 Link to this post

    Hello Oscar,

    I suggest you to use setInterval() method to perform AJAX request on given interval. You could do this by applying the following JavaScript:
    <telerik:RadCodeBlock runat="server">
        <script type="text/javascript">
            $(document).ready(function () {
                setInterval(alertMessage, 1000);
            function alertMessage() {
                $find('<%=RadAjaxManager1.ClientID %>').ajaxRequest("refreshLabel");

    You have to set the OnAjaxRequest event handler and update the RadGrid control:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />

    In code behind you shoud find the control which you want to update and make the appropriate changes. 
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        if (e.Argument == "refreshLabel")
            foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
                Label label = item.FindControl("Label1") as Label;
                label.Text = DateTime.Now.ToString();

    I prepared a small sample and attached it to this thread. I hope this helps.

    Kind regards,
    the Telerik team
    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 their blog feed now.
Back to Top