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

RadAjaxManager HELP

2 Answers 55 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Peter Karcol
Top achievements
Rank 1
Peter Karcol asked on 10 Jul 2013, 09:00 PM
Hello,

I am having a problem getting RadAjaxManager_AjaxRequest to update a control on the page.  Here is my scenario...

I have a page with RadAjaxManager declared as below...

<telerik:RadAjaxManager ID="ramMain" runat="server" OnAjaxRequest="RamMain_AjaxRequest">

I have a standard asp:Repeater bound to a datasource server side, it is wrapped in an asp:Panel and it is laid out like so..

<div runat="server" id="caseStudyDisplayPanel" class="span6">
<asp:Repeater ID="rptrCaseStudies" runat="server" ClientIDMode="Static">
<HeaderTemplate>
<ul id="List">
</HeaderTemplate>
<ItemTemplate>
<li>
<div><%# DataBinder.Eval(Container.DataItem, "Name") %></div>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
</div>

Above the repeater I have a "Add New" button which pops a RadWindow, Containing a UserControl with a RadGrid.  Each Row in the popup grid has a "Select" button, which triggers the RowSelected event.  On RowSelected I do some small javascript functions then hand off to the ajaxManager.ajaxRequest request via javascript passing over the info from the selected row.  So far so good, everything works to this point...the server side method (RamMain_AjaxRequest) gets fired and runs perfectly.  The last thing I do in the request is add my newly selected row to the datasource, and rebind the repeater.  On rebind (if I add a break point) I see exactly what I am expecting with the newly added item included in the datasource collection.  Problem is the screen never updates.  If I save at this point, and come back the item is there, so I know it is getting added, just not displayed.

What should be added to the AjaxSetting to accomplish this?  It seems I have tried every combination of controls and cannot see the update.  Here is my current seetings (which aren't working)

<telerik:AjaxSetting AjaxControlID="ramMain">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="caseStudiesWrapper" />
                    <telerik:AjaxUpdatedControl ControlID="rptrCaseStudies" />
                </UpdatedControls>
            </telerik:AjaxSetting>   
<telerik:AjaxSetting AjaxControlID="caseStudiesWrapper">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="caseStudiesWrapper" />
                </UpdatedControls>
            </telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="rptrCaseStudies">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rptrCaseStudies" />
                </UpdatedControls>
            </telerik:AjaxSetting>

Thanks So Much!!

2 Answers, 1 is accepted

Sort by
0
Peter Karcol
Top achievements
Rank 1
answered on 13 Jul 2013, 05:05 PM
Anyone have any ideas?  I'm really stumped here.  I can try to simplify the question...

If an asp link button pops a radWindow with a usercontrol containing a radgrid, and the radgrid calls back to a javascript function on the parent page, which fires off the ajaxrequest on the server side.  What controls should be configured in the telerik AjaxSettings to update the UI of a asp repeater which is nested in an asp:Panel?

Maybe that doesn't really simplify it?  Just hoping to ask in such a way that someone can make some sense of it.

Thanks.
0
Konstantin Dikov
Telerik team
answered on 15 Jul 2013, 11:08 AM
Hello Peter,

Thank you for contacting us. 

I have examined your code and your AJAX settings look properly configured. I have created a simple project with one button opening RadWindow with user control in it. In the user control there are two buttons for adding and deleting data in a xml file (with client-side ajaxRequest), using your AJAX settings in the RadAjaxManager,  which works fine on my side. Also in this case you need only one ajax setting which will indicate that the RadAjaxManager will update the Repeater. The updating of the datasource takes place in OnAjaxRequest server-side event. 

Please take a look at the attached project and see if there are any differences from your logic and let us know if this helps you with your issue.  

Best Regards,
Konstantin Dikov
Telerik
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 the blog feed now.
Tags
Ajax
Asked by
Peter Karcol
Top achievements
Rank 1
Answers by
Peter Karcol
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or