RadAjax Settings when control is set to invisible

2 posts, 0 answers
  1. Marcus
    Marcus avatar
    8 posts
    Member since:
    Jul 2007

    Posted 24 Apr 2009 Link to this post


    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();

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

            <telerik:AjaxSetting AjaxControlID="tblSelection1">
                    <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?


  2. ManniAT
    ManniAT avatar
    885 posts
    Member since:
    Nov 2003

    Posted 24 Apr 2009 Link to this post

    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.


Back to Top