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

List of opened RadWindows

2 Answers 150 Views
Window
This is a migrated thread and some comments may be shown as answers.
wnl
Top achievements
Rank 1
wnl asked on 29 Nov 2010, 12:58 PM
Hi,
Is any cleverly way to prepare a list of opened RadWindows and alway shows it in application (e.g. in any corner of a website)?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 29 Nov 2010, 01:21 PM
Hello Jaromin,

Do you need a list of the opened RadWindow's objects (e.g. code) or some visual presentation of the opened windows?
If you need to get the list of all RadWindows in client code, you could use the get_windows() method:
<form id="form1" runat="server">
<asp:ScriptManager ID="SC1" runat="server">
</asp:ScriptManager>
<script type="text/javascript">
    var nameID = 0;
    var offsetPX = 100;
    function openWins()
    {
        nameID = nameID + 1;
        offsetPX = offsetPX + 30;
        var oWnd = radopen("http://google.com", "RadWindow" + nameID);
        oWnd.set_title("RadWindow" + nameID);
        oWnd.moveTo(100, offsetPX);
 
    }
 
    function closeSpecificWin()
    {
        var windowManager = GetRadWindowManager();
        var allWindows = windowManager.get_windows();
 
 
        for (var i = 0; i < allWindows.length; i++)
        {
            var currentWindow = allWindows[i];
            if (currentWindow.get_name() == "RadWindow2")
            {
                currentWindow.close();
            }
        }
    }
 
</script>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
<button onclick="openWins();return false;">
    Open RadWindows</button>
<br />
<button onclick="closeSpecificWin();return false;">
    Close specific RadWindow (RadWindow2)</button>
</form>

If you need a visual representation, you could check our MDI demo where we use RadTabStrip along with the RadWindow control. 

All the best,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
wnl
Top achievements
Rank 1
answered on 29 Nov 2010, 03:59 PM
Thanks Georgi Tunev. I'll try that solution.
Tags
Window
Asked by
wnl
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
wnl
Top achievements
Rank 1
Share this question
or