Refresh telerik controls

3 posts, 0 answers
  1. Olo
    Olo avatar
    28 posts
    Member since:
    Nov 2008

    Posted 05 Nov 2008 Link to this post

    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. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 05 Nov 2008 Link to this post

    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:

    1 <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
    2  
    3 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
    4     <script type="text/javascript"
    5         function RadWindow_Close(sender, args) { 
    6             var ajaxManager = $find('<%= RadAjaxManager1.ClientID %>'); 
    7             ajaxManager.ajaxRequestWithTarget('<%= RadGrid1.ClientID %>'); 
    8         }            
    9     </script> 
    10 </telerik:RadCodeBlock> 
    11  
    12 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    13     <AjaxSettings> 
    14         <telerik:AjaxSetting AjaxControlID="RadGrid1"
    15             <UpdatedControls> 
    16                 <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
    17             </UpdatedControls> 
    18         </telerik:AjaxSetting> 
    19     </AjaxSettings> 
    20 </telerik:RadAjaxManager> 
    21  
    22 <telerik:RadGrid ID="RadGrid1" runat="server"
    23 </telerik:RadGrid> 
    24  
    25 <telerik:RadWindow ID="RadWindow1" runat="server"  
    26     VisibleOnPageLoad="true" 
    27     NavigateUrl="http://www.google.com"  
    28     OnClientClose="RadWindow_Close"
    29 </telerik:RadWindow> 


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

    Regards,
    Kevin Babcock
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Olo
    Olo avatar
    28 posts
    Member since:
    Nov 2008

    Posted 06 Nov 2008 Link to this post

    Thx for answer. I'll try this:)
Back to Top