AjaxSetting and downline UpdateControls

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    2 posts
    Member since:
    Jun 2008

    Posted 13 Nov 2011 Link to this post

    I have multiple ajaxsettings where I want certain items to be updated, but it appears that items I haven't specified to be updated are being updated.

    Here is an example:
    var designSetting = new AjaxSetting(SelectDesignControl.ListControl.UniqueID);
    designSetting.UpdatedControls.Add(new AjaxUpdatedControl(SelectProductControl.UniqueID, string.Empty));
    designSetting.UpdatedControls.Add(new AjaxUpdatedControl(SelectInsertControl.UniqueID, string.Empty));
    designSetting.UpdatedControls.Add(new AjaxUpdatedControl(HeroPanel.UniqueID, string.Empty));
    designSetting.UpdatedControls.Add(new AjaxUpdatedControl(AddToBagControl.UniqueID, string.Empty));
    ajaxManager.AjaxSettings.Add(designSetting);

    var productSetting = new AjaxSetting(SelectProductControl.ListControl.UniqueID);
    productSetting.UpdatedControls.Add(new AjaxUpdatedControl(SelectInsertControl.UniqueID, string.Empty));
    productSetting.UpdatedControls.Add(new AjaxUpdatedControl(HeroPanel.UniqueID, string.Empty));
    productSetting.UpdatedControls.Add(new AjaxUpdatedControl(AddToBagControl.UniqueID, string.Empty));
    ajaxManager.AjaxSettings.Add(productSetting);

    When selectproductcontrol.listcontrol is fired I don't want it to update itself, but it does. If i comment it out of the designsetting then it doesn't update. I need to have it included in that setting though.

    I believe this is because the selectproductcontrol is wrapped in an updatecontrol since it is part of the previous setting. Is there anyway to make it so the selectproductcontrol is not updated when an event in it is fired?
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 15 Nov 2011 Link to this post

    Hi Jeff,

    If a parent control for the listbox is added as updated control, the behavior you observe is expected. You can overcome it with the below code:
    protected void RadAjaxManager1_AjaxSettingCreated(object sender, AjaxSettingCreatedEventArgs e)
    {  
        if (e.Updated.ClientID == Panel1.ClientID)  
        {      
            e.UpdatePanel.ChildrenAsTriggers = false;  
        }
    }

    Where you need to replace Panel1 with the parent for the listbox control.

    Kind regards,
    Iana Tsolova
    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