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

AjaxSetting and downline UpdateControls

1 Answer 79 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 14 Nov 2011, 05:55 AM
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?

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 15 Nov 2011, 04:24 PM
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
Tags
Ajax
Asked by
Jeff
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or