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

RadAjax Settings when control is set to invisible

1 Answer 53 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Marcus
Top achievements
Rank 1
Marcus asked on 24 Apr 2009, 04:42 PM
Hi,

I have an asp.net page that dynamically adds telerik ajax settings to a page from code behind. However, they don't appear to be working... Here's the code:-

                AjaxSetting ajaxTblSelection1 = new AjaxSetting(tblSelection1.ClientID);
                AjaxUpdatedControl aucRadGrid_1 = new AjaxUpdatedControl("RadGrid1", "RadAjaxLoadingPanel1");
                AjaxUpdatedControl aucddlInvestmentHouse_1 = new AjaxUpdatedControl("ddlInvestmentHouse_1", "RadAjaxLoadingPanel1");
                AjaxUpdatedControlsCollection aucc1 = new AjaxUpdatedControlsCollection();
                aucc1.Add(aucRadGrid_1);
                aucc1.Add(aucddlInvestmentHouse_1);
                ajaxTblSelection1.UpdatedControls.AddRange(aucc1);
                RadAjaxManager1.AjaxSettings.Add(ajaxTblSelection1);

 
If I add this code directly into the page (aspx), as follows, is works fine:- 

        <telerik:AjaxSetting AjaxControlID="tblSelection1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="ddlInvestmentHouse_1" />
                <telerik:AjaxUpdatedControl ControlID="ddlIMASector_1" />

However, I need it to work from code-behind....

Any thoughts?

Marcus.

1 Answer, 1 is accepted

Sort by
0
ManniAT
Top achievements
Rank 2
answered on 24 Apr 2009, 05:08 PM
Hi Marcus,

did you ever look at the content of your page (source - fire bug  or such a tool)?
You wold notice that some controls (depending on there position) change the IDs.
So a radGrid - becomes ctl00_radGrid or something like this.

I'm not sure if this is the fact in your scenario - but try to change your code to something like:
aS.UpdatedControls.Add(new AjaxUpdatedControl(rgBackupFiles.ID, rajLoadingPanel.ID));  
 
This is just code I copied from a running solution - of course you have to use your variables.
And your bulk adding is also OK - it's just about myVar.ID instead of "myVar".

I just saw you did the "id thing" in the constructor of you ajax setting - give it a try for the updated controls also.

HTH

Manfred
Tags
Ajax
Asked by
Marcus
Top achievements
Rank 1
Answers by
ManniAT
Top achievements
Rank 2
Share this question
or