I have a scenario I'm trying to make more efficient, and although it is all working correctly, I am noticing something I just wanted to check.
On a page I have a large area which is a dynamically loaded user control which acts as a form. dvPageDetail. It adds itself as an ajaxified area programmatically like such:
this.dvPageDetail, this.dvPageDetail, LoadingPanel);
Within this area, there is a RadEditor, a bunch of other controls, and a heirarchical dropdown RadComboBox control (1st dropdown updates the list available in the second). The heirarchical dropdown also uses AddAjaxSettings to get the 1st to ComboBox to update the items in the 2nd.
oAjax.AjaxSettings.AddAjaxSetting(cmbContent, cmbSubContent, LdingPnl1);
When you select an item in the 1st combobox, a loading panel appears just over the 2nd dropdown box and its items are updated correctly. However I also notice that the Editor itself (outside of the heirarchical dropdown, but in dvPageDetail) also re-renders itself after the Ajax postback completes.
So the question is, is this happening unnecessarily and is there a way to contain what occurs in terms of re-rendering when the heirarchical dropdown control fires an Ajax postback. Or is the event bubbling up through and all of dvPageDetail is being re-rendered as well and there is no way to avoid this?
19 Answers, 1 is accepted
The observed behavior is expected and here is why - RadAjaxManager uses internally UpdatePanels to ajaxify controls. UpdatePanels have a property called ChildrenAsTriggers, which determines whether postbacks from their child controls will cause them to update their content. By default the value of this property is True.
When using RadAjaxManager, you can set ChildrenAsTriggers for a given update panel to false programmatically. Here is an example:
the Telerik team
Very good explanation, doing this sorted it out for us.
I have a near identical issue in a bit more complex scenario. I tryed the solution you proposed, but didn't seem to be able to sort it out.
My control chain is:
Master Page (wIth Ajax Manager) > Content Page (with Ajax Manager Proxy) > RadGrid > NestedViewTemplate > Asp:Panel (useless at the moment) > RadMultipage > UserControl (with Ajax Manager Proxy)
Now inside this user control I have form-like inputs (without FormView, just divs, dropdowns and RadTextBoxes and such).
What I want is to be able to use the Ajax Manager Proxy inside this User Control, without having the whole page to update.
Sinche in the content page I have:
Even if in my User Control I have something like
The whole content page is refreshed which is not what I want. I would like to be able to Ajaxify form controls inside my User Control.
I tryied with this in the content page code behind (following your suggestions above) but with no luck... full page si always updated:
Any hint on how to avoid the ajax manager (and automatically created panels) inside my User Control propagating to the whole RadGrid?
Thanks in advance
Please have a look into the sample code snippet which works fine at my end.
Content Page :
Content Page VB:
UserControl Page VB:
The only thing that differs in your example from my implementation is the "InnerContainer" panel wich I sed as visible="true" from default (and this is way I think it's useless at the moment).
Maybe this will change things... I'll do some testing and report back here! THANKS!
So in your example it's like if the DropDownList1 when changed will refresh the whole user control and also all the user controls in the pages of the multipage.
My tabstrip+multipage config
As a side note, before I had a FormView in my user control as a wrapper, with ajax manager proxy defined in each of the templates (EditItemTemplate, InsertItemTemplate) and it was working as intended so that only the referenced controls where refreshed and not the whole multipage. I had to remove it because it introduced other issues and added a layer of complexity.
Another curiosity on the approach with "InnerContainer" panel wrapping the multipage. What is this useful for?
Also let's say I want to collapse all the other rows when expaning one row ho can I set back that panel visibility to false.
I have something like this to collapse all the other rows in CommandEvent (when a user expands a row or on other custom commands)
The commented row won't work since this is a GridItem and not a GridDataItem... How to I access the GridDataItem for that GridItem? :)
EDIT(solved): About this last question I guess I just have to set the item.Expanded to false and then use the following code snipped in ItemCreated event, since ItemCommand fires first than ItemCreated. This will take care of rendering invisible all the panels inside collapsed rows.
Thanks in advance for your contribution!
Ps. I had some email contacts with Mahesh he's really a kind person and you are the best group imho.
As the scenario you are implementing appears to be rather complex it would be best if we have an option to test it locally. Therefore could I kindly ask you to open a regular support ticket and send us runnable version of your application as well as exact description of the required functionality? Thus we will be able to debug it locally and advise you further.
thank you for your kind support. It would be almost impossible for me to "exctract" that implementation from the underlying cms/framework. I will try to reproduce it from scratch using shinu code.
So in your opinion a radajaxmanager in a user control inside the multipage in nestedviewtemplate shouldn't trigger an update on all the multipage? Isn't this an "usual" scenario? Should the ajax update remain "local" to the user control?
In case you need to have the whole RadGrid control perform Ajax and not only the NestedViewTemplate the whole Grid should be ajaxified which will cause the inner control to also perform Ajax. In case you need only the UserControl placed in a PageView in the NestedViewTemplate the whole RadMultiPage should be updated. This could be done by adding programmatic settings for the nested MultiPage in the RadGrid ItemCreated event. See the demo below;
I think I need something like this
But applied to the nestedviewtemplate (or the multipage I'm still not sure where the trigger happens... I just know that all the user controls in my multipage are refreshed if I ajaxify a control inside one of them)
I'm afraid that after adding the whole RadGrid control to update itself when and inner control initiate an Ajax request the response will include the whole RadGrid contain in the response base on the updated control which is the whole RadGrid. Thus behavior could not be avoid with the current RadAjax implementation.
and this seem to have worked for the user but it's not working for me I don't know why. About this solution I would like to try (and it would be really the best option) to apply it to the multipage inside the nestedview template, so that my usercontrols inside the multipage will stop ajax propagation at the multipage level. Any hint on how to obtain this?
"Gets or sets a value that indicates whether postbacks from immediate child controls of an UpdatePanel control update the panel's content."
But I guess che a controls inside > usercontrol > multipage > panel > nestedviewtemplate > radgrid cannot be considered an immediate child of the radgrid. This makes things even more odd because I wonder why then is all submitted?
Now the firs thing that comes to my mind is that the nestedviewtemplate item OR the multipage are creating another UpdatePanel implicitly (are they?). If this is the case is there I have to change it to prevent the children triggers
With editing functionalities inside the pages in the multipage so that you can view details and if you want you can switch to edit/insert them
It should be a "straightforward" scenario but the problem described above surfaces when you want to ajaxify something inside the multipage.
PS. sorry for double posting but the "edit" option disappeared from the forum it seems :(
As the scenario you are implementing appear to be a complex one and the requirements you have could not be easily implement , could I kindly ask you to open a regular support ticket and provide us isolated runnable version of your application as well as the exact requirement you have? Thus we will have the option to review your case and apply the needed modifications to cover the required functionality.
It won't be easy for me at the moment to "isolate" a runnable example... .. anyway if I have some time I'll try to do it and open a ticket.
At the moment I'm exploring other option like RadWindow for editing/inserting functionalities in RadGrid but still it's a pity since I have the nestedviewtemplate/multipage (like in your example) to display details, it would be great to have the same look for editing.
Hi @Dimo, I know its an old post but I am having issues with nested controls as well that this solution you provided doesn't work for.
Because I have several user controls I have to use a RadAjaxManagerProxy in each one. With a single RadAjaxManager only on the default/mater page that loads the controls in questions
I have two user controls, A and B. Both use a RadGrid within them, both use RadAjaxManagerProxy each with different IDs and both contain a single RadAjaxLoadingPanel each with different IDs mapped .
A uses B in a NestedViewTemplate.
A control used used for one type of user logged in while B is used for another type.
B does not use NestViewTemplate.
A's RadAjaxLoadingPanel works find on it but B has no RadAjaxLoadingPanel displayed at all.
B's RadAjaxLoadingPanel works find when its not inside the NestedViewTemplate, making me think its setup correctly.
The only issue is when B is nested and when you do the same actions on it it does not display any loading panel, when its not being nested it does display the loading panel.
I have just answered your support ticket on this matter. As I need some more details for this issue, I will advise that we continue our discussion in it and you can freely post the solution once we find it.