Re-Bind RadGrid on RadWindow Close

2 posts, 0 answers
  1. Jay
    Jay avatar
    8 posts
    Member since:
    Jul 2008

    Posted 25 Aug 2008 Link to this post

    I have a grid on my page with some add/edit functions happening in a RadWindow control.  I'd like to execute an AJAX request to re-bind the grid when a user closes the RadWindow.  Can someone point me to a simple example of this?

    I have a javascript function firing when the RadWindow closes and I tried to do:
            function windowClose() { 
                var ajaxManager = $find("<%# RadAjaxManager1.ClientID %>"); 
                ajaxManager.AjaxRequest('Rebind_rgGallery'); 
            } 


    Where Rebind_rgGallery is a simple function to rebind the grid by overriding the raisepostbackevent.  When the script executes though, I get an 'ajaxManager has no properties' error. Any help would be appreciated.

    Thanks
  2. Jay
    Jay avatar
    8 posts
    Member since:
    Jul 2008

    Posted 25 Aug 2008 Link to this post

    Fixed this myself.  Encapsulating the code in a RadScriptBlock did the trick.

        <telerik:RadScriptBlock runat="server" ID="scriptBlock"
            <script type="text/javascript"
                function windowClose() { 
                    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
                    ajaxManager.ajaxRequest('Rebind_rgGallery'); 
                } 
            </script> 
        </telerik:RadScriptBlock> 
     
     

    and then in the code-behind...

     
     
        Protected Overloads Overrides Sub RaisePostBackEvent(ByVal sourceControl As IPostBackEventHandler, ByVal eventArgument As String
            MyBase.RaisePostBackEvent(sourceControl, eventArgument) 
     
            If TypeOf sourceControl Is Telerik.Web.UI.RadAjaxManager Then 
                Select Case eventArgument 
                    Case "Rebind_rgGallery" 
                        rgGallery.DataBind() 
                        Exit Select 
                End Select 
            End If 
        End Sub 

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top