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

Nested RadWindow gives error when closing

1 Answer 92 Views
Window
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 05 Sep 2012, 08:14 PM
I have a rad grid that has a hyperlink to open a new rad window with the selected row items details. This page switches out user controls for the content, but keeps the nav in tact. When the detail window opens, there is a link to open a new rad window that shows details. this window opens up a aspx page that also switches out user controls when nav item is clicked, When I click the close icon on the nested window, I get an error telling me that an object is expected and the window never closes. The radwindow manager is in the masterpage that both window pages inherit. below is my code. How do I get the window to close?

This is the radwindowmanager in the mser page that both pages within the radwindows inherit.

 

 

 

<telerik:RadWindowManager ID="RadWindowManager" runat="server" EnableShadow="true" Style="z-index: 2">
        <Windows>
            <telerik:RadWindow runat="server" ID="fullWindow" EnableShadow="false" VisibleStatusbar="false" CssClass="fullWindowClass"
                Behaviors="Close" ReloadOnShow="true" ShowContentDuringLoad="false" OnClientBeforeShow="fullWindow_BeforeShow" OnClientClose="fullWindow_OnClose" />
            <telerik:RadWindow runat="server" ID="smallWindow" EnableShadow="false" VisibleStatusbar="false"
                Modal="true" Behaviors="Close" ReloadOnShow="true" ShowContentDuringLoad="false"
                Width="600" Height="390" BackColor="#FFFFFF" />
            <telerik:RadWindow runat="server" ID="lmsWindow" EnableShadow="false" VisibleStatusbar="true"
                VisibleTitlebar="true" Behaviors="Close,Resize" ReloadOnShow="true" ShowContentDuringLoad="false"
                OnClientBeforeShow="fullWindow_BeforeShow" />
        </Windows>
    </telerik:RadWindowManager>
 


Here is the code that pops up the annotatedimage.aspx page.

<telerik:RadAjaxManagerProxy ID="ajaxManagerProxy" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="AjaxManager">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rightPane" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="grid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="AjaxManager" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="tvSlideGroups">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rightPane" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
<telerik:RadSplitter runat="server" ID="imageSplitter" Width="100%" Height="100%" LiveResize="true" SplitBarsSize="5px" VisibleDuringInit="false" ResizeMode="EndPane"
    CssClass="image_splitter" ResizeWithParentPane="false" OnClientLoaded="ResizeImageSplitter" OnClientResized="ResizeImageSplitter">
     
    <telerik:RadPane runat="server" Width="250" MinWidth="250" ID="imageSplitterLeftPane" CssClass="threecolumn_pane">
        <div class="treeview" style="height: 97%;">
            <ds:AnnotatedImageFolderControl runat="server" ID="annotatedImageFolderControl" />
        </div>
    </telerik:RadPane>
 
    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward" CollapseExpandPaneText="Expand/Collapse" />
     
    <telerik:RadPane runat="server" ID="imageSplitterRightPane" CssClass="threecolumn_pane">
        <asp:Panel runat="server" ID="rightPane">
            <div id="imagecontentpane">
                <div id="listheader">
                    <h2>Annotated Images</h2>
 
                    <div id="listActions">
                        <telerik:RadButton ID="btnCreateAnnotatedImage" runat="server" AutoPostBack="false" Text="Create Annotated Image" Enabled="true" OnClientClicked="ShowAddNewForm" />
                    </div>
                </div>
 
                <div id="listcontainer" style="margin-left: 10px; margin-right: 10px;">
                    <telerik:RadGrid ID="grid" runat="server" DataSourceID="ocdsSlides" AllowPaging="False" AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0"
                        GridLines="None" PageSize="50" ShowGroupPanel="true" OnColumnCreated="grid_ColumnCreated" OnItemCreated="grid_ItemCreated" OnItemCommand="grid_ItemCommand" OnBiffExporting="grid_BiffExporting">
                     
                        <ClientSettings ClientEvents-OnGridCreated="grid_created" EnableRowHoverStyle="true" AllowDragToGroup="true" AllowColumnsReorder="true">
                            <Scrolling AllowScroll="true" UseStaticHeaders="True" />
                        </ClientSettings>
                     
                        <ExportSettings ExportOnlyData="true" IgnorePaging="true" HideStructureColumns="true" FileName="AnnotatedImages">
                            <Excel Format="Biff" />
                        </ExportSettings>
                     
                        <MasterTableView DataKeyNames="SlideId" CommandItemDisplay="Top" CommandItemSettings-ShowRefreshButton="true" CommandItemSettings-ShowExportToExcelButton="true"
                            CommandItemSettings-ShowAddNewRecordButton="false">
                         
                            <Columns>
                                <telerik:GridImageColumn DataImageUrlFields="ImageId" HeaderText="THUMBNAIL" Reorderable="false" UniqueName="ThumbnailColumn" ImageHeight="50"
                                    ImageWidth="50" HeaderStyle-Width="80" ItemStyle-Width="80" HeaderStyle-HorizontalAlign="Center" AlternateText="Preview"
                                    ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridBoundColumn DataField="SlideId" Visible="false" />
                                <telerik:GridBoundColumn DataField="SlideName" HeaderText="Name" ItemStyle-Wrap="true" HeaderStyle-Width="200" ItemStyle-Width="200" HeaderStyle-HorizontalAlign="Center"
                                    ItemStyle-HorizontalAlign="Left" />
                                <telerik:GridBoundColumn DataField="FolderName" HeaderText="Folder Name" ItemStyle-Wrap="true" HeaderStyle-Width="200" ItemStyle-Width="200" HeaderStyle-HorizontalAlign="Center"
                                    ItemStyle-HorizontalAlign="Left" />
                                <telerik:GridTemplateColumn HeaderText="ACTIONS" UniqueName="Actions" HeaderStyle-Width="130" ItemStyle-Width="130" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <div style="text-align: center;">
                                            <asp:HyperLink runat="server" ID="lnkManage" Text="Manage" NavigateUrl="#" /> |
                                            <asp:HyperLink runat="server" ID="lnkPreview" Text="Preview" NavigateUrl="#" />
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="ImageName" HeaderText="Source Image Name" ItemStyle-Wrap="true" HeaderStyle-Width="190" ItemStyle-Width="200"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <telerik:GridBoundColumn DataField="Revision" HeaderText="Revision" HeaderStyle-Width="60" ItemStyle-Width="55" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridBoundColumn DataField="RevisionDate" HeaderText="Revision Date" HeaderStyle-Width="80" ItemStyle-Width="80" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:MM/dd/yyyy}" />
                                <telerik:GridBoundColumn DataField="Levels" HeaderText="Z-Planes" HeaderStyle-Width="70" ItemStyle-Width="65" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridBoundColumn DataField="RegionOfInterestCount" HeaderText="ROIs" HeaderStyle-Width="45" ItemStyle-Width="50" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridBoundColumn DataField="PinCount" HeaderText="Pins" HeaderStyle-Width="50" ItemStyle-Width="50" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridBoundColumn DataField="BucketCount" HeaderText="Buckets" HeaderStyle-Width="65" ItemStyle-Width="65" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridBoundColumn DataField="ArrowCount" HeaderText="Arrows" HeaderStyle-Width="60" ItemStyle-Width="60" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridBoundColumn DataField="LMSCourseId" HeaderText="LMS Course" HeaderStyle-Width="70" ItemStyle-Width="70" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridBoundColumn DataField="ForPreview" HeaderText="Allow Sharing" HeaderStyle-Width="65" ItemStyle-Width="65" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                <telerik:GridBoundColumn DataField="ForMobile" HeaderText="Allow Mobile" HeaderStyle-Width="65" ItemStyle-Width="65" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                            </Columns>
 
                            <NoRecordsTemplate>
                                <h2>No Folders Selected or No Records</h2>
                            </NoRecordsTemplate>
                        </MasterTableView>
                    </telerik:RadGrid>
                </div>
            </div>
        </asp:Panel>
    </telerik:RadPane>
</telerik:RadSplitter>
 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function ShowAlert(message) {
            radalert(message, null, null, "Message");
            return false;
        }
 
        function ShowDetailForm(id, rowIndex) {
            OpenWindow("<%=ResolveClientUrl("~/Images/AnnotatedImage.aspx?Id=")%>" + id);
            return false;
        }
 
        function ShowViewerForm(id) {
            OpenWindow("<%=ResolveClientUrl("~/Viewer.aspx?SlideId=")%>" + id);
            return false;
        }
 
        function ShowAddNewForm() {
            OpenWindow("<%=ResolveClientUrl("~/Images/CreateAnnotatedImage.aspx")%>");
            return false;
        }
 
        $(window).resize(function () {
            resizegrid();
        });
 
        function responseEnd(sender, eventArgs) {
            resizegrid();
        }
 
        function grid_created(sender, args) {
            resizegrid();
        }
 
        function left_resized(sender, args) {
            overview_leftpane_width = sender.get_width();
            resizegrid();
        }
 
        function resizegrid() {
            var grid = $find("<%= grid.ClientID %>");
 
            var docHeight = getDocHeight();
            var nudge = 85;
            var header = $('#header-wrap').height();
            var footer = $('#footer-wrap').height();
 
            if (grid != null)
            {
                grid.get_element().style.height = docHeight - header - footer - nudge + "px";
                grid.repaint();
            }
        }
 
        function GridCreated(sender, eventArgs) {
            resizegrid();
        }
 
        function ResizeImageSplitter(sender, args) {
            sender.set_height($(window).height() - $("#header-wrap").height() - $("#footer-wrap").height() - 12);
        }
 
        function OpenWindow(path) {
            window.radopen(path, "fullWindow");
        }
    </script>
</telerik:RadScriptBlock>

Here is the annotated image page that loads the user controls when a navigation node is clicked.

<%@ Page Title="Annotated Image: " Language="C#" MasterPageFile="~/MasterPages/Empty.Master" AutoEventWireup="true" CodeBehind="AnnotatedImage.aspx.cs" Inherits="DigitalScope.Web.Images.AnnotatedImage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphScriptsStyles" runat="server">
    <script type="text/javascript">
        function showConfirmWindow(sender, args) {
            var window = $find("<%= confirmWindow.ClientID %>");
 
            var slideId = sender.get_commandArgument();
 
            if (window) {
                window.set_showContentDuringLoad(false);
                window.setUrl("DeleteLayer.aspx?SlideID=" + slideId);
                window.show();
            }
        }
 
        function onSilverlightLoad(sender, args) {
            var sl = $("#silverlight_container");
            if (sl) {
                var docHeight = getDocHeight();
                var listheader = $("#listheader").height();
 
                sl.height(docHeight - listheader - 15);
            }
        }
 
        function onSilverlightError(sender, args) {
            var appSource = "";
            if (sender != null && sender != 0) {
                appSource = sender.getHost().Source;
            }
 
            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;
 
            if (errorType == "ImageError" || errorType == "MediaError") {
                return;
            }
 
            var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";
 
            errMsg += "Code: " + iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";
 
            if (errorType == "ParserError") {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError") {
                if (args.lineNumber != 0) {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " + args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }
 
            throw new Error(errMsg);
        }
 
        function splitter_load(sender) {
            resizeSplitter();
        }
 
        function splitter_resized(sender, args) {
            resizeSplitter();
        }
 
        function resizeSplitter() {
            var splitter = $find("<%= splitter.ClientID %>");
 
            var docHeight = getDocHeight();
            var header = $('#header-wrap').height();
            var footer = $('#footer-wrap').height();
 
            splitter.set_height(docHeight - header - footer);
 
            if (typeof ResizeListContainer == 'function') {
                ResizeListContainer();
            }
        }
 
        function ResizeListContainer() {
            var splitter = $(".column_splitter").first();
            var listheader = $("#listheader").height();
            var listfooter = $("#listfooter").height();
            var listcontainer = $("#listcontainer").height();
            var nudge = 50;
 
            if (splitter) {
                $("#listcontainer").height(splitter.height() - listfooter - listheader - nudge)
            }
        }
 
        function getDocHeight() {
            var D = document;
            return Math.max(
                Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
                Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
                Math.max(D.body.clientHeight, D.documentElement.clientHeight)
            );
        }
 
        function CloseAndRebind(args) {
            GetRadWindow().BrowserWindow.RefreshGrid(args);
            GetRadWindow().close();
        }
 
        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 Close() {
            GetRadWindow().close();
             
        }
 
        $(document).ready(function () {
            GetRadWindow().add_beforeClose(GetRadWindow().BrowserWindow.RefreshGrid);
        });
 
        function showEmailWindow() {
            var window = $find("<%= emailLinkWindow.ClientID %>").show();
        }
 
        function selectNode(text) {
            var treeView = $find("<%= tvActions.ClientID %>");
            var node = treeView.findNodeByText(text);
            node.select();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
    <telerik:RadAjaxManager runat="server" ID="AjaxManager" OnAjaxRequest="AjaxManager_AjaxRequest" EnablePageHeadUpdate="true" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="tvActions">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="multiPage" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="multiPage" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadButton runat="server" ID="btnResetView" OnClick="btnResetView_Click" Visible="false" />
    <telerik:RadWindow runat="server" ID="confirmWindow" Title="Delete Annotation Layer" Modal="true" Behaviors="Close, Move" Height="475" Width="500" VisibleStatusbar="false" BackColor="White" />
    <telerik:RadWindow runat="server" ID="emailLinkWindow" Title="Email Link" Modal="true" OnClientShow="" Behaviors="Close" Height="300" Width="600"
        VisibleStatusbar="false">
        <ContentTemplate>
            <div class="form">
                <div class="row">
                    <telerik:RadTextBox runat="server" Width="550px" ID="tbToEmail" Label="To" />
                </div>
                <div class="validationRow">
                    <div class="right">
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1"
                            ControlToValidate="tbToEmail"
                            ErrorMessage="Invalid email"
                            Display="Dynamic"
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            runat="server" />
                    </div>                   
                </div>
                <div class="row">
                    <telerik:RadTextBox runat="server" Width="550px" ID="tbFromEmail" Label="From" />
                </div>
                <div class="validationRow">
                    <div class="right">
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2"
                            ControlToValidate="tbFromEmail"
                            ErrorMessage="Invalid email"
                            Display="Dynamic"
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            runat="server" />
                    </div>                   
                </div>
                <div class="row">
                    <telerik:RadTextBox runat="server" Width="550px" ID="tbBodyEmail" Label="Body" TextMode="MultiLine" Rows="4" />
                </div>
                <div class="row">
                    <telerik:RadButton ID="RadButton1" runat="server" Text="Send" OnClick="btnShareEmail_Click" />
                </div>          
            </div>
        </ContentTemplate>
    </telerik:RadWindow>
    <telerik:RadSplitter runat="server" ID="splitter" Width="100%" Height="95%" LiveResize="true" SplitBarsSize="5px" VisibleDuringInit="false" ResizeMode="EndPane" CssClass="column_splitter" OnClientLoaded="splitter_load" OnClientResized="splitter_resized">
        <telerik:RadPane runat="server" ID="rightPane" Width="200" MinWidth="200" CssClass="twocolumn_pane" Scrolling="None">
            <div id="listheader">
                <h2>Actions</h2>
            </div>
            <div id="listcontainer">
                <telerik:RadTreeView ID="tvActions" runat="server" CausesValidation="false"
                    OnNodeClick="tvActions_NodeClick" onprerender="tvActions_PreRender">
                    <Nodes>
                        <telerik:RadTreeNode Text="Overview" Value="Overview" Selected="true" />
                        <telerik:RadTreeNode Text="Edit" Value="Edit" />
                        <telerik:RadTreeNode Text="Annotate" Value="Annotate" />
                        <%--<telerik:RadTreeNode Text="Set Key" Value="SetKey" />--%>
                        <telerik:RadTreeNode Text="Preview" Value="Preview" />
                        <telerik:RadTreeNode Text="Revision History" Value="RevisionHistory" />
                        <telerik:RadTreeNode Text="Delete" Value="Delete" />
                        <%--<telerik:RadTreeNode Text="Sharing" Value="Sharing" />--%>
                    </Nodes>
                </telerik:RadTreeView>
            </div>
            <div id="listfooter">
                <telerik:RadButton ID="RadButton2" runat="server" CausesValidation="false" Text="Back To List" OnClick="btnClose_Click" />
            </div>                      
        </telerik:RadPane>
        <telerik:RadSplitBar runat="server" CollapseMode="Forward" CollapseExpandPaneText="Expand/Collapse">
        </telerik:RadSplitBar>
        <telerik:RadPane runat="server" CssClass="twocolumn_pane">
            <telerik:RadMultiPage ID="multiPage" runat="server" SelectedIndex="0" ScrollBars="Auto" Height="95%"
                OnPageViewCreated="multiPage_PageViewCreated" CssClass="multiPage" />           
        </telerik:RadPane>
    </telerik:RadSplitter>
 
    <telerik:RadCodeBlock runat="server" ID="Rad">
        <script type="text/javascript" language="javascript">
             
        </script>
</telerik:RadCodeBlock>
</asp:Content>

Here is the user control code with the javascript that opens the second detail window.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AnnotatedImage_Overview.ascx.cs" Inherits="DigitalScope.Web.Images.controls.AnnotatedImage_Overview" %>
<%@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls" TagPrefix="pp" %>
 
<div id="listheader">
    <h2>Annotated Image - <asp:Literal ID="litSlideName" runat="server"></asp:Literal></h2>
</div>
<asp:FormView ID="fvDetails" runat="server" DataSourceID="ocdsSlide" OnDataBound="fvDetails_DataBound" HorizontalAlign="Center" Width="100%">
    <ItemTemplate>
        <div class="form formHeader">
            Annotated Image Information
        </div>
        <div class="form">
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="The Name of the annotated image." />
                <span class="left">Name:</span>
                <div class="right">
                    <asp:Literal ID="tbSlideName" runat="server" Text='<%# Eval("SlideName") %>' />
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="The Revision Number of the annotated image." />
                <span class="left">Revision:</span>
                <div class="right">
                    <asp:Literal ID="tbSlideRevision" runat="server" Text='<%# Eval("Revision") %>' />
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="The Folder(s) that the annotated image belongs to." />
                <span class="left">Folder(s):</span>
                <div class="right">
                    <asp:Literal runat="server" ID="litSlideGroups" />                       
                </div>                               
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="The name of the source image this annotated image is based on." />
                <span class="left">Source Image:</span>
                <div class="right">
                    <asp:Hyperlink ID="hlSourceImageName" runat="server" CssClass="color" />                       
                </div>                               
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="The default zoom level to use when navigating to regions of interest." />
                <span class="left">Default Zoom:</span>
                <div class="right">
                    <asp:Literal runat="server" ID="litDefaultZoom" />                       
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="The maximum zoom as a percentage of the total magnification." />
                <span class="left">Max Zoom:</span>
                <div class="right">
                    <asp:Literal runat="server" ID="litMaxZoom" />                       
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="Link to LMS course (if present)." />
                <span class="left">LMS Course:</span>
                <div class="right">
                    <asp:Hyperlink runat="server" ID="lnkLMSCourseId" Target="_blank" Text="Not Set" ForeColor="#000000" />                       
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="Specifies if this annotated image is available for preview without logging in." />
                <span class="left">For Preview:</span>
                <div class="right">
                    <telerik:RadButton ID="RadButton1" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox" ReadOnly="true" Checked='<%# Eval("ForPreview").ToString().ToLower().Equals("true") %>' />
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="Specifies if this annotated image is available on mobile devices." />
                <span class="left">For Mobile:</span>
                <div class="right">
                    <telerik:RadButton ID="RadButton2" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox" ReadOnly="true" Checked='<%# Eval("ForMobile").ToString().ToLower().Equals("true") %>' />
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="Case history for the annotated image." />
                <span class="left">Case History:</span>
                <div class="right">
                    <asp:Literal runat="server" ID="litCaseHistory" Text='<%# Eval("CaseHistory") %>' />
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="Description for the annotated image." />
                <span class="left">Description:</span>
                <div class="right">
                    <asp:Literal runat="server" ID="litSlideDescription" Text='<%# Eval("Description") %>' />
                </div>
            </div>      
        </div>
        <div class="form formHeader">
            Share A Link to this Annotated Image
        </div>
        <div class="form">
            <a href="#" style="color: #1c7aa7 !important;" onclick='showEmailWindow();'>Email Link to this Annotated Image</a>
        </div>
        <div class="form formHeader">
            Annotation Types
        </div>
        <div class="form">
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="Regions of Interest (green boxes) for the annotated image." />
                <span class="left">Regions Of Interest (ROI):</span>
                <div class="right">
                    <telerik:RadGrid ID="gvStatistics" runat="server" AutoGenerateColumns="false" DataSourceID="ocdsRegionsOfInterest"
                        AllowSorting="true" AllowPaging="false" AllowFilteringByColumn="false" ShowGroupPanel="false"
                        EnableLinqExpressions="false" PagerStyle-AlwaysVisible="true">
                        <ClientSettings AllowDragToGroup="false" EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" />
                        <MasterTableView CommandItemDisplay="None" DataKeyNames="RegionOfInterestId">
                            <Columns>
                                <telerik:GridBoundColumn DataField="RegionOfInterestId" Visible="false" />
                                <telerik:GridBoundColumn DataField="Text" HeaderText="ROI Text" />
                                <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments" />
                                <telerik:GridBoundColumn DataField="EnableGrading" HeaderText="Enable Grading" Visible="false" />
                                <telerik:GridBoundColumn DataField="Enabled" HeaderText="Enabled" Visible="false" />                                                                                                                                             
                            </Columns>
                            <NoRecordsTemplate>
                                No Regions of Interest (ROI)
                            </NoRecordsTemplate>
                        </MasterTableView>
                    </telerik:RadGrid>
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="Arrows for the annotated image." />
                <span class="left">Arrows:</span>
                <div class="right">
                    <telerik:RadGrid ID="rgArrows" runat="server" AutoGenerateColumns="false" DataSourceID="ocdsArrows"
                        AllowSorting="true" AllowPaging="false" AllowFilteringByColumn="false" ShowGroupPanel="false"
                        EnableLinqExpressions="false" PagerStyle-AlwaysVisible="true">
                        <ClientSettings AllowDragToGroup="false" EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" />
                        <MasterTableView CommandItemDisplay="None" DataKeyNames="ArrowId">
                            <Columns>
                                <telerik:GridBoundColumn DataField="ArrowId" Visible="false" />
                                <telerik:GridBoundColumn DataField="Text" HeaderText="Arrow Text" />                                                                                                                                     
                            </Columns>
                            <NoRecordsTemplate>
                                No Arrows
                            </NoRecordsTemplate>
                        </MasterTableView>
                    </telerik:RadGrid>
                </div>
            </div>
        </div>
        <div class="form formHeader">
            Quiz Components
        </div>
        <div class="form">
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="Pins (annotations) for the annotated image." />
                <span class="left">Pins:</span>
                <div class="right">
                    <div class="RadGrid RadGrid_Metro" tabindex="0">
                        <table class="rgMasterTable" cellspacing="0" border="0" style="width:100%;table-layout:auto;empty-cells:show;">
                            <colgroup>
                                <col>
                            </colgroup>
                            <thead>
                                <tr>
                                    <th class="rgHeader" scope="col">
                                        <a>Pins Tree</a>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr class="rgNoRecords">
                                    <td style="text-align:left;" colspan="1">
                                        <asp:Literal runat="server" ID="litNoPins" Text="No Pins" Visible="false" />
                                        <telerik:RadTreeView ID="tvPins" runat="server" DataSourceID="ocdsPins" DataFieldID="AnnotationId" DataFieldParentID="ParentAnnotationId" DataTextField="Text" Style="white-space: normal;" />
                                    </td>
                                </tr>
                            </tbody>
                        </table>      
                    </div>                        
                </div>
            </div>
            <div class="row">
                <img alt="info" src="../Pictures/info.png" class="info" text="Buckets (categories) for the annotated image." />
                <span class="left">Buckets:</span>
                <div class="right">
                    <telerik:RadGrid ID="rgBuckets" runat="server" AutoGenerateColumns="false" DataSourceID="ocdsBuckets"
                        AllowSorting="true" AllowPaging="false" AllowFilteringByColumn="false" ShowGroupPanel="false"
                        EnableLinqExpressions="false" PagerStyle-AlwaysVisible="true">
                        <ClientSettings AllowDragToGroup="false" EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" />
                        <MasterTableView CommandItemDisplay="None" DataKeyNames="CategoryId">
                            <Columns>
                                <telerik:GridBoundColumn DataField="CategoryId" Visible="false" />
                                <telerik:GridBoundColumn DataField="Text" HeaderText="Bucket Text" />    
                                <telerik:GridBoundColumn DataField="Enabled" HeaderText="Enabled" Visible="false" />                                                                                                                                      
                            </Columns>
                            <NoRecordsTemplate>
                                No Buckets
                            </NoRecordsTemplate>
                        </MasterTableView>
                    </telerik:RadGrid>
                </div>
            </div>
        </div>
    </ItemTemplate>
</asp:FormView>
 
<telerik:RadScriptBlock runat="server">
    <script type="text/javascript" language="javascript">
        function ShowDetailForm(id) {
            rWindow = window.radWindow;
            window.radopen("SourceImage.aspx?Id=" + id, "fullWindow");
            return false;
        }
    </script>
</telerik:RadScriptBlock>


Here is the code file for the sourceimage.aspx file (this is the page that is in the second radwindow that will not close due to an error.)

<%@ Page Title="Source Image: " Language="C#" MasterPageFile="~/MasterPages/Empty.Master" AutoEventWireup="true" CodeBehind="SourceImage.aspx.cs" Inherits="DigitalScope.Web.Images.SourceImage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphScriptsStyles" runat="server">
    <style type="text/css">
        .column_splitter table {
            width: 100% !important;
        }
         
        .column_splitter .twocolumn_pane {
            overflow: auto !important;
        }
    </style>
    <script type="text/javascript" src="../Scripts/SourceImages.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".multiPage").parent().css("height", "100%");
        });
 
        function onSilverlightLoad(sender, args) {
            var sl = $("#silverlight_container");
            if (sl) {
                var docHeight = getDocHeight();
                var listheader = $("#listheader").height();
 
                sl.height(docHeight - listheader - 15);
            }
        }
 
        function onSilverlightError(sender, args) {
            var appSource = "";
            if (sender != null && sender != 0) {
                appSource = sender.getHost().Source;
            }
 
            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;
 
            if (errorType == "ImageError" || errorType == "MediaError") {
                return;
            }
 
            var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";
 
            errMsg += "Code: " + iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";
 
            if (errorType == "ParserError") {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError") {
                if (args.lineNumber != 0) {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " + args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }
 
            throw new Error(errMsg);
        }
 
        function splitter_load(sender) {
            resizeSplitter();
        }
 
        function splitter_resized(sender, args) {
            resizeSplitter();
        }
 
        function resizeSplitter() {
            var splitter = $find("<%= splitter.ClientID %>");
 
            var docHeight = getDocHeight();
            var header = $('#header-wrap').height();
            var footer = $('#footer-wrap').height();
 
            splitter.set_height(docHeight - header - footer);
 
            if (typeof ResizeListContainer == 'function') {
                ResizeListContainer();
            }
        }
 
        function ResizeListContainer() {
            var splitter = $(".column_splitter").first();
            var listheader = $("#listheader").height();
            var listfooter = $("#listfooter").height();
            var listcontainer = $("#listcontainer").height();
            var nudge = 50;
 
            if (splitter) {
                $("#listcontainer").height(splitter.height() - listfooter - listheader - nudge)
            }
        }
 
        function getDocHeight() {
            var D = document;
            return Math.max(
                Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
                Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
                Math.max(D.body.clientHeight, D.documentElement.clientHeight)
            );
        }
 
        function CloseAndRebind(args) {
            GetRadWindow().BrowserWindow.RefreshGrid(args);
            GetRadWindow().close();
        }
 
        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 Close() {
            GetRadWindow().close();
        }
 
        $(document).ready(function () {
            GetRadWindow().add_beforeClose(GetRadWindow().BrowserWindow.RefreshGrid);
        });
 
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager" runat="server" EnablePageHeadUpdate="true">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="tvActions">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="multiPage" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadButton runat="server" ID="btnResetView" OnClick="btnResetView_Click" Width="0px" Height="0px" Visible="false" />
    <telerik:RadSplitter runat="server" ID="splitter" Width="100%" Height="95%" LiveResize="true" SplitBarsSize="5px" VisibleDuringInit="false" ResizeMode="EndPane" CssClass="column_splitter" OnClientLoaded="splitter_load" OnClientResized="splitter_resized">
        <telerik:RadPane runat="server" ID="rightPane" Width="200" MinWidth="200" CssClass="twocolumn_pane" Scrolling="None">
            <div id="listheader">
                <h2>Actions</h2>
            </div>
            <div id="listcontainer">
                <telerik:RadTreeView ID="tvActions" runat="server" CausesValidation="false"
                    OnNodeClick="tvActions_NodeClick" onprerender="tvActions_PreRender">
                    <Nodes>
                        <telerik:RadTreeNode Text="Overview" Value="Overview" Selected="true" />
                        <telerik:RadTreeNode Text="Edit" Value="Edit" />
                        <telerik:RadTreeNode Text="Preview" Value="Preview" />
                        <telerik:RadTreeNode Text="Revision History" Value="RevisionHistory" />
                        <%--<telerik:RadTreeNode Text="Delete" Value="Delete" />--%>
                    </Nodes>
                </telerik:RadTreeView>
            </div>
            <div id="listfooter">
                <telerik:RadButton ID="RadButton2" runat="server" CausesValidation="false" Text="Back To List" OnClick="btnClose_Click" />
            </div>                      
        </telerik:RadPane>
        <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward" CollapseExpandPaneText="Expand/Collapse">
        </telerik:RadSplitBar>
        <telerik:RadPane ID="RadPane1" runat="server" CssClass="twocolumn_pane">
            <telerik:RadMultiPage ID="multiPage" runat="server" SelectedIndex="0" ScrollBars="Auto"
                OnPageViewCreated="multiPage_PageViewCreated" CssClass="multiPage" />           
        </telerik:RadPane>
    </telerik:RadSplitter>
</asp:Content>

any help would be much appreciated.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Sep 2012, 11:29 AM
Hello Brandon,

I cannot run this code because of the missing dependencies, code-behind and the general project structure that will show me what is going on. What I can advise at this point is the following:

1) Make sure you are getting a reference to the current RadWindow from inside with the GetRadWindow() function shown in this help article: http://www.telerik.com/help/aspnet-ajax/window-programming-opening-from-within-dialog.html.

2) Use the approach from the above article to open your RadWindows to avoid nesting them. This will also enable you to have only one RadWindowmanager on the main page and will spare the need to declare more in each page

3) Examine your page for any JavaScript error thrown by your custom code, for example the document.ready jQuery handler.

If you still cannot resolve this I advise that you open a support ticket and send us a simple, fully runnable project that can show us the problem so we can help you.

Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Window
Asked by
Brandon
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or