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

editing with a RADWindow

1 Answer 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 17 Mar 2009, 03:03 PM
Im trying to implement an insert/edit fucnction utilising a RADWindow.  The example provided
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx

uses a RadAjaxManager and then the following code

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "Rebind")
            {
                RadGrid1.MasterTableView.SortExpressions.Clear();
                RadGrid1.MasterTableView.GroupByExpressions.Clear();
                RadGrid1.Rebind();
            }
            else if (e.Argument == "RebindAndNavigate")
            {
                RadGrid1.MasterTableView.SortExpressions.Clear();
                RadGrid1.MasterTableView.GroupByExpressions.Clear();
                RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
                RadGrid1.Rebind();
            }
        }


However, Im using a master page that contians the RADAJAX manager so I have a 

RadAjaxManagerProxy on the child form.  This has no associated AJAXRequest event so how do I get around this ?

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 20 Mar 2009, 01:12 PM
Hello Mark,

To attain the functionality you are searching for you need to wire the code for the RadAjaxManager's AjaxRequest event. Then on the client-side you just need to call ajaxRequest() method of the RadAjaxManger. Here is a code snippet showing how to achieve this:
protected void Page_Load(object sender, EventArgs e) 
    { 
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page); 
        manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest); 
    } 
 
    protected void manager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) 
    { 
        //handle the manager AjaxRequest event here 
    } 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
 
        <script type="text/javascript"
            function myUserControlClickHandler() 
            {
                $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("content"); 
            } 
        </script> 
 
    </telerik:RadCodeBlock> 

For further information please review this online help topic devoted on this matter.

Sincerely yours,
Georgi Krustev
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
mww
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or