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

Dynamically creatings Radwindows

2 Answers 68 Views
Window
This is a migrated thread and some comments may be shown as answers.
jerry
Top achievements
Rank 1
jerry asked on 16 Dec 2008, 05:39 PM
Hello,
I would like to be able to cycle through a listbox and take all the rows the user selects and display each one of his selections in seperate RadWindows. 

For example my list box contains
Yahoo - Value = http://www.yahoo.com
MSN    - Value = http://www.MSN.com
CNN - Value  = http://www.CNN.com

So my user selects Yahoo & CNN then clicks a button.  At this point I want two seperate windows one for yahoo and one for CNN.

Is this possible? Can it be done WITHOUT using javascript?

Thank You
Jerry

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Dec 2008, 07:13 AM
Hi Jerry,

Try the code snippets shown below.

JavaScript:
<asp:ListBox ID="ListBox1" runat="server" SelectionMode="Multiple"
    <asp:ListItem Value="http://google.com">Google</asp:ListItem> 
    <asp:ListItem Value="http://www.yahoo.com">Yahoo</asp:ListItem> 
    <asp:ListItem Value="http://www.CNN.com">CNN</asp:ListItem> 
</asp:ListBox> 
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Open Windows" /> 

CS:
protected void Button1_Click(object sender, EventArgs e) 
    for (int i = 0; i < ListBox1.Items.Count; ++i) 
    { 
        if (ListBox1.Items[i].Selected == true
        { 
            RadWindow newWindow = new RadWindow(); 
            newWindow.NavigateUrl = ListBox1.Items[i].Value; 
            newWindow.VisibleOnPageLoad = true
            form1.Controls.Add(newWindow); 
        } 
    } 

Thanks,
Shinu.
0
jerry
Top achievements
Rank 1
answered on 17 Dec 2008, 03:25 PM
Shinu,
Thank You that did it.


Jerry
Tags
Window
Asked by
jerry
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
jerry
Top achievements
Rank 1
Share this question
or