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

How to open a radwindow programmitically?

4 Answers 383 Views
Window
This is a migrated thread and some comments may be shown as answers.
Saad
Top achievements
Rank 1
Saad asked on 15 Nov 2008, 12:40 PM
I want to open a Radwindow in some event. I need to open window programmitically....how could i do this?
For an example i`v taken a button and in its click event i want to do it....please help!
Thank you Telerik

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Nov 2008, 04:40 AM
Hi Saadi,

You can set the RadWindow properties from server side and can open the RadWindow. In order to achieve that, you have to add RadWindowManager in page and add the windows dynamically. Please try the below code snippet.

ASPX:

<telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    </telerik:RadWindowManager> 
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Open Window" /> 

C#:
protected void Button1_Click(object sender, EventArgs e) 
    { 
        RadWindow newWindow = new RadWindow(); 
        newWindow.NavigateUrl = "http://www.google.com"
        newWindow.Top = Unit.Pixel(22);
        newWindow.VisibleOnPageLoad=true;
        newWindow.Left = Unit.Pixel(0); 
        RadWindowManager1.Windows.Add(newWindow); 
    } 

You can also refer to these links for more information about this.
Setting Server-Side Properties
Setting RadWindow and RadWindowManager properties serverside

Thanks,
Shinu.













0
fduverseau
Top achievements
Rank 1
answered on 09 Dec 2008, 12:56 PM
Hello,

I also need to do the same thing on the server-side because I need to run some code before opening the window.

I've tried the above sample code but the window opens only after the second button click...

How can I make the window open on the first click?

BTW: Both controls are located inside an UpdatePanel control inside a MasterPage

Thank you

Frantz
0
Svetlina Anati
Telerik team
answered on 09 Dec 2008, 01:25 PM
Hello Frantz,

I am not quite sure what might be happening on your side until I examine your code. I prepared a sample demo project based on your explanations but everything is working as expected - the RadWindow is shown every time the button is clicked, including the very first time. Please, examine the test demo and in case your problem persists, please modify the demo in order to reproduce your problem, open a new support ticket and send it to us along with detailed reproduction instructions and explanations.


Sincerely yours,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
fduverseau
Top achievements
Rank 1
answered on 11 Dec 2008, 08:21 PM
Hi Svetlina,

I was missing this line of code:
newWindow.VisibleOnPageLoad=true;

Thanks



Tags
Window
Asked by
Saad
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
fduverseau
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or