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

Ajax updating controls when it is not supposed to

3 Answers 61 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Kevin Cauchi
Top achievements
Rank 1
Kevin Cauchi asked on 18 Nov 2011, 12:52 PM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Mira
Telerik team
answered on 23 Nov 2011, 08:57 AM
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
0
Kevin Cauchi
Top achievements
Rank 1
answered on 23 Nov 2011, 09:07 AM
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...
0
Mira
Telerik team
answered on 25 Nov 2011, 02:18 PM
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
Tags
Ajax
Asked by
Kevin Cauchi
Top achievements
Rank 1
Answers by
Mira
Telerik team
Kevin Cauchi
Top achievements
Rank 1
Share this question
or