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

closed radwindow still exist in window

5 Answers 109 Views
Window
This is a migrated thread and some comments may be shown as answers.
yao wang
Top achievements
Rank 1
yao wang asked on 13 May 2010, 02:28 AM
Thanks for your help, which really help me a lot. I have a new question about closed radwindow.

After close radwindows, they disappeared from the window, however when I used the code as following. var allWindows = GetRadWindowManager().GetWindows();

allwindows still includes the closed radwindow. I add the ownd.close(), it does not work, how can I get the closed window out of the collection list?

Thanks again.

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 May 2010, 06:47 AM

Hi Yao,

Set the DestroyOnClose property of RadWindow to True. If property is set to true, the window will be disposed and made inaccessible once it is closed.

-Shinu.

0
Georgi Tunev
Telerik team
answered on 13 May 2010, 06:54 AM
Hello yao wang,

Set DestroyOnClose to true - this would destroy the RadWindow object once the window is closed (i.e. it will not remain hidden on the page).


Sincerely yours,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
yao wang
Top achievements
Rank 1
answered on 13 May 2010, 02:37 PM
Hi Shinu and Georgi,

Thanks a lot for your help.

I added the code as following.  

var pos = GetFirstAvailablePos();

 

oWnd = radopen(

 

"http://www.google.com/", null);  

 

 

oWnd.SetTitle(

 

"Widget" +titleNum);

 

 

oWnd.SetSize(200, 200);

oWnd.DestroyOnClose = 

 

true;  

 

 

oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Resize);

oWnd.add_close(OnClientClose);

oWnd.moveTo(pos.left, pos.top);

 

 

 

 

 

 

function OnClientClose(oWnd, eventArgs) {  

oWnd.close();

oWnd.DestroyOnClose =

 

true;

 

 

}

Then I used the code as following, the closed window is still in the allwindows list, please help me to find out why, thanks again. 

 

 

 

 

 

 

 

var allWindows = GetRadWindowManager().GetWindows();  

 

for (var i = 0; i < allWindows.length; i++) {

 ......

 

 


}

 

 

 

 

0
Georgi Tunev
Telerik team
answered on 14 May 2010, 06:03 AM
DestroyOnClose is a property - set it to the RadWindowManager and it will work as expected.
e.g.
<telerik:radwindowmanager id=RadWindowManager1 runat=server DestroyOnClose=true ..... />


Greetings,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
yao wang
Top achievements
Rank 1
answered on 14 May 2010, 02:48 PM
Thanks a lot, it works very well now.

Have a good weekend,

Yao
Tags
Window
Asked by
yao wang
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Georgi Tunev
Telerik team
yao wang
Top achievements
Rank 1
Share this question
or