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

radWindow Close problem

7 Answers 288 Views
Window
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 07 Mar 2008, 03:38 PM
I have a Prometheus radWindow that pops up when I click a button on my radGrid.  The radWindow pops like I want.  But now I want to close the popup radwindow when I click a asp.net button.  How can I do this?

Thanks,
Bob

7 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 07 Mar 2008, 03:47 PM
Hi Bob,

You should have reference to the window object and then apply the close() method on it. More information on taking a reference and using this method you can find here.

Basically you should call javascript function like this on the button onclick event:

function closeWindow() 
{    
  var oWnd = $find("<%= RadWindow1.ClientID %>");    
  oWnd.close();  
}   

where RadWindow1 is the ID of your RadWindow.

Greetings,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 07 Mar 2008, 04:04 PM
I'm still lost George.  Sorry, but I'm not too strong with javascript.  I put the closeWindow() function on my pop-up page right?  But now I get an error that says RadWindow1 is not declared.  I double-checked and my ID on my radWindow="RadWindow1" on my parent page.

Also, as you respond, please let me know if the code or javascript function goes on the pop-up page or the parent page.

thanks,
Bob
0
Georgi Tunev
Telerik team
answered on 07 Mar 2008, 05:47 PM
Hi Bob,

I prepared a small sample for you that shows how to open and close RadWindow by using its Client-Side API and outputting a Javascript function from the server. Please check the code and use the approach that suits your requirements.

More information on RadWindow's API can be found in the documentation, section Controls / RadWindow / Programming.



Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Bob
Top achievements
Rank 1
answered on 07 Mar 2008, 06:21 PM
Hi George,

I cannot use the sample you sent me because I have to open my window differently.  I open the radwindow from my radgrid row thru a button.  And I pass it a querystring.  I probably should have told you this in the beginning.  So the NavigateURL on the readwindow control will not work.  Here is how I call my radwindow from my radgrid:

<

Telerik:GridTemplateColumn>

<ItemTemplate>

<a href="#" onclick="openRadWindow('<%#DataBinder.Eval(Container.DataItem,"TaskID")%>'); return false;">Tasks</a>

</ItemTemplate>

</Telerik:GridTemplateColumn>


And here is the realted javascript function:

<

script type="text/javascript">

function OpenPositionedWindow(oButton, url, windowName)

{

var oWnd = window.radopen(url,windowName);

}

function openRadWindow(TaskID)

{

var oWnd = radopen("TaskMaintenance.aspx?TaskID=" + TaskID, "RadWindow1" );

oWnd.Center();

}

</script>



The pop-up window does appear.  I simply want to close this popup window when an ASP:Button is clicked and return to my parent page.  I hope this additional code that I presented helps.  Like I said earlier, I am terrible with javascript so be patient with me. :)
0
Bob
Top achievements
Rank 1
answered on 07 Mar 2008, 06:34 PM
George,

I did get it working by using your asp:button example in my child window.  I thought I had tried this before but I must have done something wrong.  Anyway, it works now.  I appreciate your help!
0
Doug Bellenger
Top achievements
Rank 2
answered on 24 Sep 2008, 08:23 PM
Your example worked like a charm.  Thanks!
0
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 26 Dec 2008, 01:42 PM
if you dont need an asp:button you can use
<input type="button" value="Close" onclick="javascript:closeWin();"  />
Tags
Window
Asked by
Bob
Top achievements
Rank 1
Answers by
George
Telerik team
Bob
Top achievements
Rank 1
Georgi Tunev
Telerik team
Doug Bellenger
Top achievements
Rank 2
Morten
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or