Open a radwindow from Server side

13 posts, 0 answers
  1. Andy Ho
    Andy Ho avatar
    41 posts
    Member since:
    May 2010

    Posted 25 Aug 2010 Link to this post

    Hi,

    I tried to use a RadWindows as a container, I put a radtextbox it in.
    Then I wanted my user to right click on a listbox item and then Click "Edit"  (from a RadContextMenu), I want to update the textbox based on the user's selection. So I need to open RadWindow from Server Side code. But if I use the OpenElementID properties, the client side event of the "Edit" item won't be fired.

    Any idea?

    Andy Ho
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Aug 2010 Link to this post

    Hello Andy,


    The following code snippet shows how to open radwindow from code behind.

    CS:
    RadWindow window1 = new RadWindow();
    window1.NavigateUrl = "http://www.google.com";
    window1.VisibleOnPageLoad = true;
    window1.Width = 500;
    window1.Height = 300;
    this.form1.Controls.Add(window1);
    Setting Server-Side Properties

    You can also try one of the approaches described in this KB article.


    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Ho
    Andy Ho avatar
    41 posts
    Member since:
    May 2010

    Posted 26 Aug 2010 Link to this post

    Hi,

    Thanks for your reply. But I can't create the radwindow from server side as I already create the window declaractively. So what I need is to show that RadWindow but not create that RadWindow.

    Can I simply use VisibleOnPageLoad =true to make it work?


    Andy Ho
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 27 Aug 2010 Link to this post

    Hello Andy,

    Absolutely - if the RadWindow is already present on the page, setting VisibleOnPageLoad to true will make it show.


    Greetings,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 06 Dec 2010 Link to this post

    Hi ,

    I used   RadWindowManager1.Windows[2].VisibleOnPageLoad = true; on server side code to display Radwindow. I am closing it  on button click as below. Everything is working as expected (window closes, grid rebinds) but I see a java script error. How can I avoid this javascript error ( b is null), this seems to be related to some callback function. Can someone help me in solving this.



    Javascript:
    In Main page:
     function refreshScheduler(arg) {
                           $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindSchedule|");
                   }


    Javascript in a page that is  opened in RadWindow
    function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)
              
            return oWindow;
        }
        
        function CloseWnd()
        {
            GetRadWindow().BrowserWindow.refreshScheduler();
            GetRadWindow().close();
        }

     C# code
    On Button Click close rad window:
           ScriptManager.RegisterStartupScript(this, GetType(), "closeWnd", "CloseWnd();", true);



    Thanks
    Prava
  7. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 08 Dec 2010 Link to this post


    I fixed the issue using javascript function.
  8. sankara
    sankara avatar
    3 posts
    Member since:
    Nov 2010

    Posted 14 Dec 2010 Link to this post

    Hi,

    i added a radwindow in my page, that is worked perfectly befor adding "RadFileExplorer", after added fileexplorer it's style changed to FileExplorer style.

    i used this code.
     

     

     

     

    telerik:RadWindowManager ID="RadWindowManager1" runat="server" ReloadOnShow="true" ShowContentDuringLoad="False" VisibleStatusbar="False" Behavior="Default" InitialBehavior="None" EnableEmbeddedSkins="False" EnableEmbeddedBaseStylesheet="False" Font-Names="Tahoma" VisibleOnPageLoad="false" Style="z-index: 8000;" DestroyOnClose="True">
    <Windows<telerik:RadWindow ID="window1" runat="server" IconUrl="none" Behavior="Close" DestroyOnClose="True" Modal="True" Width="650px" Height="190px" ></telerik:RadWindow></Windows></telerik:RadWindowManager>

     

     

     

     

     

     

    <tr><td colspan="2"><telerik:RadFileExplorer ID="testFileExp" runat="server" Skin="Office2007" Width="100%"></telerik:RadFileExplorer></td></tr>

     

     



    i have added images please find the images.

  9. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 15 Dec 2010 Link to this post

    Hi Sankara,

    This behavior is expected - RadFileExplorer uses its own RadWindowManager to show the dialogs. RadWindowManager's functions (radopen, radalert, radpromt, GetRadWindowManager, etc.) however, always use the last RadWindowManager that is rendered on the page - in this case, it would be the one from the RadFileExplorer with its Skin property set to Office2007.
    To open a RadWindow from a specific RadWindowManager, you need to get a reference to it first and then call its open() method (which is the same as the radopen() one).
    e.g.

    <telerik:RadWindowManager
        ID="RadWindowManager1"
        runat="server"
        ReloadOnShow="true"
        ShowContentDuringLoad="False"
        VisibleStatusbar="False"
        Behavior="Default"
        InitialBehavior="None"
        Skin="Black"
        Font-Names="Tahoma"
        VisibleOnPageLoad="false"
        Style="z-index: 8000;"
        DestroyOnClose="True">
        <Windows>
            <telerik:RadWindow ID="window1" runat="server" IconUrl="none" Behavior="Close" DestroyOnClose="True"
                Modal="True" Width="650px" Height="190px">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <telerik:RadFileExplorer ID="testFileExp" runat="server" Skin="Office2007" Width="100%"></telerik:RadFileExplorer>
            <script type="text/javascript">
                function showSpecificWin()
                {
                    var oWndManager = $find("<%= RadWindowManager1.ClientID %>");
                    oWndManager.open('http://bing.com', 'window1');
                }
               
            </script>
    <button onclick="showSpecificWin(); return false;">test</button>


    Greetings,
    Georgi Tunev
    the Telerik team
    Browse the vast support resources we have to jump start 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.
  10. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 26 Aug 2015 in reply to Georgi Tunev Link to this post

    I'm using Q3 2014.  Apparently, the Style (eg. "Style="z-index: 8000;") property must've been taken out of RadWindowManager, because it doesn't show in the dropdown.
  11. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 31 Aug 2015 Link to this post

    Hi John,

    Setting a z-index style to the window manager works properly on my side - http://www.telerik.com/support/kb/aspnet-ajax/window/details/show-radwindow-above-radmenu

    Could you please elaborate more about the issue - what is the actual and the expected behavior of the control? Also, does upgrading to the latest version - 2015.2.826 helps?

    Regards,
    Danail Vasilev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  12. John
    John avatar
    43 posts
    Member since:
    Aug 2014

    Posted 31 Aug 2015 in reply to Danail Vasilev Link to this post

    Actually, I went ahead and tried adding the Style property to my RadWindowManager.  It works fine in version Q3 2014.  My only observation was that it wasn't listed on the dropdown that pops-up (intellisense ???) when adding a property.
  13. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 01 Sep 2015 Link to this post

    Hi John,

    The Style property is not a standard property for a server control, even a simple Panel control does not show it: http://screencast.com/t/YBMNDi6tY. It is treated like a custom attribute by intellisense for some reason.

    Regards,

    Marin Bratanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  14. sushant
    sushant avatar
    2 posts
    Member since:
    Sep 2008

    Posted 29 Feb Link to this post

    Hi

    I have main page and I am using rad window in it like below.
    Main Page
    <telerik:RadWindowManager RegisterWithScriptManager="true" ID="wmgWindowManager" ReloadOnShow="true" runat="server"
            Behavior="Move" ShowContentDuringLoad="false" DestroyOnClose="true">
            <windows>
                <telerik:RadWindow ID="wndAssignPerformer" RegisterWithScriptManager="true"  ShowContentDuringLoad="false" runat="server" OnClientClose="RefreshPerformer" />
            </windows>
            <confirmtemplate>
                <uc:Confirm ID="confirmValidation" runat="server"></uc:Confirm>
            </confirmtemplate>
        </telerik:RadWindowManager>

    Inside above rad window I am opening another page "Sub_Page.aspx". Inside "Sub_Page" I am using pop up extender like below.
     <telerik:radpopupextender  id="extPopup" runat="server" OnOkSelected="extPopup_OkSelected" >
            <telerik:RadPopupControl UniqueId="ReassignPerformer" WindowManagerId="wmgWindowManager" Disabled="true" ControlId="btnSave"
                MessageType="Confirm" Height="120" Width="450" PostBackOnOk="true" PostBackOnCancel="false"
                StartupScript="true" TitleKey="CONFIRMATION" MessageKey="REASSIGNPERFORMER" />
            <afs:RadPopupControl UniqueId="ReassignClaimOwner" WindowManagerId="wmgWindowManager" Disabled="true" ControlId="btnSave"
                MessageType="Confirm" Height="120" Width="450" PostBackOnOk="true" PostBackOnCancel="false"
                StartupScript="true" TitleKey="CONFIRMATION" MessageKey="REASSIGNCLAIMOWNER" />
        </telerik:radpopupextender>

        <telerik:radwindowmanager id="wmgWindowManager" runat="server">
            <Windows>
                <telerik:RadWindow ID="wndAssignPerformer" runat="server" />
            </Windows>
            <ConfirmTemplate>
                <uc:Confirm ID="confirmValidation" runat="server"></uc:Confirm>
            </ConfirmTemplate>
        </telerik:radwindowmanager>
    on OnOkSelected event of pop up extender I am calling "extPopup_OkSelected" function of code behind file like below.
     private void extPopup_OkSelected(System.Object sender, System.EventArgs e)
            {
               //do some server coding
               System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(),
                        "Javascript", "function closeWindowOnSave(){var oWnd = $find(\"<%= wndAssignPerformer.ClientID%>\"); if(oWnd !=null){oWnd.close()} else {window.parent.close();} ;} closeWindowOnSave();", true);
                }
            }
        My issue is that when I click on OK button my modal pop up get spinning. I want that when I click on Ok, after server processing complete my modal pop up  
       should close. But my javascript is not getting called from page behind
       When I am opening "Sub_Page" directly from browser javascript is getting executed but when it opens inside rad window it is not.
       I am facing this issue is Internet Explorer 11 only. Can you please help on this?
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017