Window

Controls

Rate this demo

Thank you for your post!

Window - Client-side Events

This demo contains 1 or more dialog pages. To view them, hover over the dropdown button () in the Example Source Code & Description section
Event console

Clear log Event log:

Client-Side Events


RadWindow provides the following client-side events:

  • OnClientBeforeShow - fires just before the RadWindow is shown. You can cancel the show of the RadWindow there
  • OnClientShow - fires after RadWindow is shown
  • OnClientActivate - fires when RadWindow becomes the active window
  • OnClientPageLoad - fires when the page in RadWindow completesloading
  • OnClientBeforeClose - fires just before the RadWindow is closed. You can cancel the closing of the RadWindow there.
  • OnClientClose - fires after RadWindow is being closed
  • OnClientDragStart - fires when the user starts dragging a RadWindow object
  • OnClientDragEnd - fires after RadWindow is being dropped on the page
  • OnClientResize - fires when a RadWindow is being resized
  • OnClientResizeStart - called when the user starts resizing the window.
  • OnClientResizeEnd - called after a resize operation ends.
  • OnClientAutoSizeEnd - fires when a RadWindow's autosize has finished
  • OnClientCommand - fires when the commands Pin, Reload, Minimize and Maximize are executed (when the user presses a titlebar button).

The properties expect the name of a clientside function to be called. When invoked, two arguments are supplied to the function - the sender[the RadWindow itself], and an events argument.

When using the close() method to close a RadWindow you can provide an argument to it and it can be extracted through the arguments of the OnClientClose event by using their get_argument() method. The OnClientbeforeClose and OnClientCommand can be cancelled by the set_cancel(shouldCancel) method the event arguments object provides. Additionally, the OnClientCommand provides the get_commandName() method to get the command that was just fired.
C# VB
Show code in new window Demo isolation steps
<%@ Page Language="C#"  %>

<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <title>ASP.NET Window Demo - Client-side Events</title>
     <script src="scripts.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
     <qsf:InformationBox ID="InformationBox1" runat="server">
          <span style="font-size: 12px;">This demo contains 1 or more dialog pages.
               To view them, hover over the dropdown button (<span class="qsfExpandImage">&#9660;</span>)
               in the <em>Example Source Code &amp; Description</em> section</span>
     </qsf:InformationBox>
     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
          <script type="text/javascript">
          </script>
     </telerik:RadCodeBlock>
     <div class="qsf-ib" style="width:450px;">
          <strong>Event console</strong>
     </div>
     <div class="qsf-ib">
          <asp:Button ID="Button1" runat="server" OnClientClick="OpenWnd();return false;" Text="Open RadWindow">
          </asp:Button>
     </div>
     <br class="qsf-clear-float" />
     <div class="qsf-ib" style="width:450px; vertical-align:top;">
          <qsf:EventLogConsole ID="EventLogConsole1" runat="server" AllowClear="true" Width="400px"
               Height="300px"></qsf:EventLogConsole>
     </div>
     <div id="RestrictionZone" class="qsf-ib" style="width:340px; height:340px;">
          <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
               <Windows>
                    <telerik:RadWindow runat="server" ID="RadWindow1" ReloadOnShow="true" RestrictionZoneID="RestrictionZone"
                         Height="300px" Width="400px" NavigateUrl="Dialog.aspx" VisibleOnPageLoad="true"
                         AutoSize="true" Animation="Fade" OpenerElementID="link1" OnClientCommand="OnClientCommand"
                         ShowContentDuringLoad="false" OnClientResizeStart="OnClientResizeStart" OnClientResizeEnd="OnClientResizeEnd"
                         OnClientDragStart="OnClientDragStart" OnClientDragEnd="OnClientDragEnd" OnClientActivate="OnClientActivate"
                         OnClientPageLoad="OnClientPageLoad" OnClientBeforeClose="OnClientBeforeClose"
                         OnClientClose="OnClientclose" OnClientShow="OnClientshow" OnClientBeforeShow="OnClientBeforeShow"
                         OnClientAutoSizeEnd="OnClientAutoSizeEnd">
                    </telerik:RadWindow>
               </Windows>
          </telerik:RadWindowManager>
     </div>
     <script type="text/javascript">
          Sys.Application.add_load(function () {
               button = $get("<%=Button1.ClientID %>");
          })
     </script>
    </form>
</body>
</html>