Ajax updating controls when it is not supposed to

4 posts, 1 answers
  1. Kevin Cauchi
    Kevin Cauchi avatar
    38 posts
    Member since:
    Dec 2009

    Posted 18 Nov 2011 Link to this post

    Hi there,

    I have a timer that updates a grid on a condition. For example:

    if (IsDifferentFilter())
    {
             //Load logs method is called so the datagrid will be updated
             Thread logsThread = new Thread(new ThreadStart(LoadLogs));
             logsThread.Start();
             logsThread.Join();
    }
    //else the datagrid will NOT be updated

    The issue here is that even though the datagrid is NOT updated, it still gets refreshed. When I say refeshed i mean its just the datagrid not the whole page.

    The grid is ajaxisfied using:

    <telerik:RadAjaxManagerProxy ID="radAjaxManagerProxyLogs" runat="server" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="tmrAutoFilter">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="dgLogs" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="dgLogs">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="dgLogs" LoadingPanelID="ldgBar" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>


    Any help would be appreciated.

    Thanks

    K

    Edited (Nov-21-2011): I realized the OnInit code is being triggered after each timer tick as well. That is not normal is it
  2. Answer
    Mira
    Admin
    Mira avatar
    1124 posts

    Posted 23 Nov 2011 Link to this post

    Hello Kevin,

    The described behavior is expected because the RadAjaxManager wraps the updated controls in update panels with UpdateMode="Conditional".
    You can examine the ASP.NET Page Life Cycle to see why the OnInit is triggered.

    I hope this helps.

    Greetings,
    Mira
    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
  3. Kevin Cauchi
    Kevin Cauchi avatar
    38 posts
    Member since:
    Dec 2009

    Posted 23 Nov 2011 Link to this post

    Thanks for your reply.

    Just to be 100% sure..:

    So there is no work around updating controls when their values aren't updated. Correct?
    .. meaning, if i have a drop down list in an Ajax panel and the drop down list is currently open, the DDL will be closed when it is time to be refreshed...
  4. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 25 Nov 2011 Link to this post

    Hello Kevin,

    You are indeed right - the described behavior is expected due to the way the MS AJAX framework works.

    Best wishes,
    Mira
    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