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

RadAjaxManagerProxy - Using the find

5 Answers 81 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
John Giblin
Top achievements
Rank 1
John Giblin asked on 19 Nov 2009, 10:53 PM
I have switched the RadAjaxManager to the MasterPage and added the RadAjaxManagerProxy to the custom control.  My problem is when I use the find method it is no longer anymore.  I am not sure what I am dong wrong here.


function refreshDependantsGrid(arg)
{
    if(arg=='')
         $find("<%= RadAjaxManager1.GetCurrent(this.Page).ClientID %>").ajaxRequest("Grid1Rebind");
    else
         $find("<%= RadAjaxManager1.GetCurrent(this.Page).ClientID %>").ajaxRequest("Grid1RebindAndNavigate");
}
function refreshCommentsGrid(arg)
{

    if(arg=='')
         $find("<%= RadAjaxManagerProxy1.ClientID %>").ajaxRequest("Grid2Rebind");        
    else
         $find("<%= RadAjaxManagerProxy1.ClientID %>").ajaxRequest("Grid2RebindAndNavigate");        
}   

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
        </UpdatedControls>
    </telerik:AjaxSetting>
....

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 20 Nov 2009, 12:23 PM
Hello John,

To see more information along the lines of the requested functionality, please refer to the following article:
RadAjax and WebUserControls

I hope it gets you started properly.

Regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
John Giblin
Top achievements
Rank 1
answered on 23 Nov 2009, 12:21 AM
That article doesnt not quite explain everything.

I am not sure how this methods maps to the .cs file

$find(

"<%= Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page).ClientID %>").ajaxRequest("Grid2Rebind");

The RadAjaxProxyManager does not have an event for AjaxRequest like RadAjaxManger

I need to map Grid2Rebind event to the method in the cs file.  How do I do that?



 

 

protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)

 

{

 

if (e.Argument == "Grid2Rebind")

 

{

RadGrid2.MasterTableView.SortExpressions.Clear();

RadGrid2.MasterTableView.GroupByExpressions.Clear();

RadGrid2.Rebind();

}

 

else if (e.Argument == "Grid2RebindAndNavigate")

 

{

RadGrid2.MasterTableView.SortExpressions.Clear();

RadGrid2.MasterTableView.GroupByExpressions.Clear();

 

// RadGrid2.MasterTableView.CurrentPageIndex = RadGrid2.MasterTableView.PageCount - 1;

 

 

 

 

RadGrid2.Rebind();

}


}

0
Pavlina
Telerik team
answered on 25 Nov 2009, 03:47 PM
Hi John,

RadAjaxManagerProxy control is designed completely for design-time purposes so it does not include AjaxRequest either client or server-side events. This is the approach we recommend to follow: put the manager in the master page and get it any time you need to trigger an AJAX request client and server-side as shown in the article bellow:
AJAX Manager Proxy

Greetings,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
John Giblin
Top achievements
Rank 1
answered on 25 Nov 2009, 11:29 PM
I looked at the  article.  I dont get how the ajax request "content" is hooked up as shown below.  Would the be in the masterpage? thanks




 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
       
<script type="text/javascript">
           
function myUserControlClickHandler()
           {
               
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("content");
           }
       
</script>
   
</telerik:RadCodeBlock>


0
Pavlina
Telerik team
answered on 26 Nov 2009, 01:53 PM
Hi John,

Attached to this message is a simple working project which handles the desired functonality. Please give it a try and let me know if it works for you or if I am leaving something out.

I hope this helps.

Kind regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
John Giblin
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
John Giblin
Top achievements
Rank 1
Share this question
or