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

RadWindow loading message/image

1 Answer 134 Views
Window
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 11 Jun 2012, 06:45 PM
Hi

I have a number of rad windows in the page which pull a page from a related external site with video
content. Instead of a blank window waiting for the external page, I would prefer a text message or a default
loading panel as for radAjaxPanel for example, but I can't see how to make this work.

I have seen reference in posts to a default loading panel but see no property of the window that relates to that.

Help would be appreciated!   (Using Q2 2010 and asp.net 4.0 on this site)

Thanks

Clive

My current window is 
<telerik:RadWindow ID="RadWindowVid" runat="server" OpenerElementID="div495" Width="560px"
        Animation="Fade" Behaviors="Close" VisibleStatusbar="False" Title="Bessacarr Cameo 495"
        Skin="WebBlue" OnClientClose="OnClientClose">
</telerik:RadWindow>

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Jun 2012, 06:06 AM
Hi Clive Hoggar,

Following is the sample code that I tried to achieve your scenario.

ASPX:
<div id="loading" style=" width: 100px; height: 50px; display: none; text-align: center; margin: auto;">
    loading...
</div>
<asp:Button ID="RadButton1" runat="server" Text="RadButton1" OnClientClick="openRadWnd(); return false;" />
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
   <Windows>
      <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="http://converter.telerik.com" ShowContentDuringLoad="false" OnClientShow="OnClientShow" OnClientPageLoad="OnClientPageLoad">
      </telerik:RadWindow>
   </Windows>
</telerik:RadWindowManager>

JS:
<script type="text/javascript">
    var loadingSign = null;
    var contentCell = null;
    function openRadWnd() {
        $find("<%=RadWindow1.ClientID %>").show();
    }
    function OnClientShow(sender, args) {
        loadingSign = $get("loading");
        contentCell = sender._contentCell;
        if (contentCell && loadingSign) {
            contentCell.appendChild(loadingSign);
            contentCell.style.verticalAlign = "middle";
            loadingSign.style.display = "";
        }
    }
    function OnClientPageLoad(sender, args) {
        if (contentCell && loadingSign) {
            contentCell.removeChild(loadingSign);
            contentCell.style.verticalAlign = "";
            loadingSign.style.display = "none";
        }
    }
</script>

Note: Please make sure that you have set ShowContentDuringLoad property of the RadWindow to false

Hope this helps.

Thanks,
Princy.
Tags
Window
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or