OnClientShow
The OnClientShow event of the RadWindow fires when the popup shows. It follows the OnClientBeforeShow event.
RadWindow renders its popup element with JavaScript when it is shown for the first time, so this is the earliest event in which you can manipulate it.
You can use this event to change settings of the RadWindow that will affect its behavior, e.g., making sure it is always maximized (Example 1) or pinned (Example 2). The OnClientShow event is commonly used for adding dynamic handlers for other events that may be needed only once (e.g., to OnClientPageLoad or to OnClientClose - Example 3).
The event handler receives the following arguments:
The RadWindow object that fired the event.
An event arguments object that does not expose any methods and properties.
<asp:Button ID="Button4" Text="show the RadWindow" runat="server" />
<telerik:RadWindow RenderMode="Lightweight" runat="server" ID="RadWindow1" OnClientShow="OnClientShowHandler" OpenerElementId="Button1"></telerik:RadWindow>
<script type="text/javascript">
function OnClientShowHandler(sender, args) {
sender.maximize();
}
</script>
<asp:Button ID="Button5" Text="show the RadWindow" runat="server" />
<telerik:RadWindow RenderMode="Lightweight" runat="server" ID="RadWindow1" OnClientShow="OnClientShowHandler" OpenerElementId="Button1"></telerik:RadWindow>
<script type="text/javascript">
function OnClientShowHandler(sender, args) {
if (!sender.isPinned()) {
sender.togglePin();
}
}
</script>
<asp:Button ID="Button6" Text="show the RadWindow" runat="server" />
<telerik:RadWindow RenderMode="Lightweight" runat="server" ID="RadWindow1" OnClientShow="OnClientShowHandler" OpenerElementId="Button1" NavigateUrl="some-page.aspx"></telerik:RadWindow>
<script type="text/javascript">
function OnClientShowHandler(sender, args) {
sender.add_close(OnClientCloseHandler);
sender.add_pageLoad(OnClientPageLoadHandler);
}
function OnClientCloseHandler(sender, args) {
sender.remove_close(OnClientCloseHandler);
alert("The dialog is closed");
}
function OnClientPageLoadHandler(sender, args) {
sender.remove_pageLoad(OnClientPageLoadHandler);
sender.set_status("");
}
</script>