How to open a radwindow programmitically?

5 posts, 0 answers
  1. Saad
    Saad avatar
    82 posts
    Member since:
    Oct 2008

    Posted 15 Nov 2008 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Nov 2008 Link to this post

    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.













  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. fduverseau
    fduverseau avatar
    7 posts
    Member since:
    Apr 2005

    Posted 09 Dec 2008 Link to this post

    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
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 09 Dec 2008 Link to this post

    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.
  6. fduverseau
    fduverseau avatar
    7 posts
    Member since:
    Apr 2005

    Posted 11 Dec 2008 Link to this post

    Hi Svetlina,

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

    Thanks



Back to Top
UI for ASP.NET Ajax is Ready for VS 2017