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

[Solved] Close Window from Formview

3 Answers 224 Views
Window
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 2
Brett asked on 07 Mar 2008, 03:44 AM
I have a formview inside my radwindows.  After Insert or Cancel is clicked I want the window to close and the parent to refresh.

How do I go about this?

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 07 Mar 2008, 07:37 AM
Hello bslaght,

You can hook to the OnClientClose event of the RadWIndow and use document.location.reload() or document.location.href = document.location.href to reload / refresh the page.

e.g.
<script type="text/javascript">
function OnClientClose(sender,args)
{
//your code here
}
</script>
<telerik:radwindow id="RadWindow1" runat="server" OnClientClose="OnClientClose" />




Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Brett
Top achievements
Rank 2
answered on 08 Mar 2008, 04:25 PM
Hi Georgi,
 That answers the refresh part of my question however, I still don't know how to force the window to close when I click insert on cancel on my formview.

I know I will need to hook into my formview itemcommand, but i don't know what to code in there to close my rad window.  Please advise.

0
Georgi Tunev
Telerik team
answered on 10 Mar 2008, 02:11 PM
Hello bslaght,

If I understand you correctly, you wish to close the RadWindow after you do some processing on the server from the content page (that is displayed in the RadWindow), am I right?

If this is so, I suggest to check the following KB article
http://www.telerik.com/support/kb/article/b454K-gtd-b454T-cec-b454c-cec.aspx

There you can see how to call Javascript code from the server in several scenarios - this example closely matches your case. You only need to replace the radalert calling function with the one that closes the RadWindow - GetRadWindow().close() (You must have the GetRadWindow() function declared on your content page before that).

I hope this helps.


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Brett
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
Brett
Top achievements
Rank 2
Share this question
or