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

Open a radwindow from Server side

12 Answers 2468 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andy Ho
Top achievements
Rank 1
Andy Ho asked on 25 Aug 2010, 10:15 AM
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

12 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Aug 2010, 11:04 AM
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.
0
Andy Ho
Top achievements
Rank 1
answered on 26 Aug 2010, 06:50 AM
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
0
Georgi Tunev
Telerik team
answered on 27 Aug 2010, 07:08 AM
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
0
Prava kafle
Top achievements
Rank 1
answered on 06 Dec 2010, 08:10 PM
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
0
Prava kafle
Top achievements
Rank 1
answered on 08 Dec 2010, 03:38 PM

I fixed the issue using javascript function.
0
sankara
Top achievements
Rank 1
answered on 14 Dec 2010, 07:45 AM
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.

0
Georgi Tunev
Telerik team
answered on 15 Dec 2010, 10:22 AM
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.
0
John
Top achievements
Rank 1
answered on 26 Aug 2015, 07:50 PM
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.
0
Danail Vasilev
Telerik team
answered on 31 Aug 2015, 10:44 AM
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
0
John
Top achievements
Rank 1
answered on 31 Aug 2015, 03:57 PM
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.
0
Marin Bratanov
Telerik team
answered on 01 Sep 2015, 03:58 PM

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
0
sushant
Top achievements
Rank 1
answered on 01 Mar 2016, 05:37 AM
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?
Tags
Window
Asked by
Andy Ho
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Andy Ho
Top achievements
Rank 1
Georgi Tunev
Telerik team
Prava kafle
Top achievements
Rank 1
sankara
Top achievements
Rank 1
John
Top achievements
Rank 1
Danail Vasilev
Telerik team
Marin Bratanov
Telerik team
sushant
Top achievements
Rank 1
Share this question
or