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

Re-Bind RadGrid on RadWindow Close

1 Answer 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 2
Jay asked on 25 Aug 2008, 03:44 PM
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

1 Answer, 1 is accepted

Sort by
0
Jay
Top achievements
Rank 2
answered on 25 Aug 2008, 08:24 PM
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 

Tags
Grid
Asked by
Jay
Top achievements
Rank 2
Answers by
Jay
Top achievements
Rank 2
Share this question
or