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

Refresh telerik controls

2 Answers 154 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Olo
Top achievements
Rank 1
Olo asked on 05 Nov 2008, 06:22 PM
Hi and sorry for my english skills:),
I have 2 web pages (asp.net, radwindow). On the fist page I have RadGrid. From this page I open second page (so booth radwindow are open). On this (2nd) page I  update some value in database.
How can I refresh only RadGrid on the first page when I close the second page?
Thx for reply.

2 Answers, 1 is accepted

Sort by
0
Kevin Babcock
Top achievements
Rank 1
answered on 06 Nov 2008, 02:41 AM
Hi Olo,

You can very easily refresh the RadGrid on your page when the RadWindow closes by taking advantage of the rich, built-in client-side API of the RadControls. What you can do is define a client-side event-handler for the RadWindow's OnClientClose event, which is fired when the RadWindow is closed, and then from that event handler you can call your RadAjaxManager's ajaxRequestWithTarget() function and pass in the ClientID of your RadGrid. This will cause an Ajax request to be sent to the server that target's the RadGrid, and will refresh the RadGrid when the request completes. Here is a simple example:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
    <script type="text/javascript"
        function RadWindow_Close(sender, args) { 
            var ajaxManager = $find('<%= RadAjaxManager1.ClientID %>'); 
            ajaxManager.ajaxRequestWithTarget('<%= RadGrid1.ClientID %>'); 
        }            
    </script> 
</telerik:RadCodeBlock> 
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 
<telerik:RadGrid ID="RadGrid1" runat="server"
</telerik:RadGrid> 
 
<telerik:RadWindow ID="RadWindow1" runat="server"  
    VisibleOnPageLoad="true" 
    NavigateUrl="http://www.google.com"  
    OnClientClose="RadWindow_Close"
</telerik:RadWindow> 


I hope this helps. Let know if you have any further questions.

Regards,
Kevin Babcock
0
Olo
Top achievements
Rank 1
answered on 06 Nov 2008, 07:41 PM
Thx for answer. I'll try this:)
Tags
General Discussions
Asked by
Olo
Top achievements
Rank 1
Answers by
Kevin Babcock
Top achievements
Rank 1
Olo
Top achievements
Rank 1
Share this question
or