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

Close radwindow when button click inside a formview

1 Answer 106 Views
Window
This is a migrated thread and some comments may be shown as answers.
MARS-Jainith
Top achievements
Rank 1
MARS-Jainith asked on 22 Nov 2012, 03:08 PM
I have a formview inside my radwindow.  If close button is clicked inside a formview I want the window to close.
I tried to call javascript to close window, event is fired, but it does not close the window.
**********  Javascript ************

 function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow)
                    oWindow = window.radWindow;
                else if (window.frameElement.radWindow)
                    oWindow = window.frameElement.radWindow;
                return oWindow;
            }

            function Close() {
                var arg = new Object();
                var oWnd = GetRadWindow();
                oWnd.close(arg);  
            }

********** Button to close the radwindow inside formview **************
      <asp:LinkButton ID="lnkBtnClose" runat="server" CausesValidation="False" CommandName="Close"                                    Text="Close" ToolTip="Close"  OnClientClick="Close(); return false;" />

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 23 Nov 2012, 10:41 PM
Hello MARS-Jainith,

Are you using the ContentTemplate of the RadWindow control? If so, you can't use the GetRadWindow function to get a reference to the RadWindow. You'll need to close the RadWindow directly, like so:

$find("<%=RadWindow1.ClientID%>").close();

I hope that helps.
Tags
Window
Asked by
MARS-Jainith
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Share this question
or