Access first RadWindow in code behind.

4 posts, 1 answers
  1. Henry
    Henry avatar
    44 posts
    Member since:
    Feb 2013

    Posted 07 Mar 2013 Link to this post

    Hi folks,

    There is a RadWindowManager in my form and has four windows. How to access the first RadWindow in the Window Manager from code behind?

    Thanks.
    Henry.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Mar 2013 Link to this post

    Hello Henry,

    Please check the following code to access the first RadWindow in the RadWindowManager.

    C#:
    //Get a reference to the first window in the list
    Telerik.Web.UI.RadWindow firstWindow = WindowManager.Windows[0];

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Alex
    Alex avatar
    16 posts
    Member since:
    Nov 2012

    Posted 31 Jul 2013 Link to this post

    is there any way to reference the window by its ID instead of index?
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 01 Aug 2013 Link to this post

    Hi Alex,

    You cannot use any property(such as ID) other than the Index to find the RadWindow if you are using the RadWindowManager1.Windows.. statement as shown in the previous post.

    Even if you have your RadWindow inside the RadWindowManager, you can access it directly with the help of ID in C# as shown below.

    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server">
            </telerik:RadWindow>
            <telerik:RadWindow ID="RadWindow2" runat="server">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

    C#:
    RadWindow1.NavigateUrl = "http://www.telerik.com";

    Thanks,
    Princy.
Back to Top