RadControls for ASP.NET AJAX
(which may or may not contain methods, depending on the event).
OnClientBeforeShow - fires just before the RadWindow is shown. You can cancel the show of the RadWindow there
OnClientShow - called after the window is shown.
OnClientActivate - called when the window becomes the active window.
OnClientPageLoad - called when the page in the content window completes loading.
OnClientBeforeClose - called before the RadWindow is being closed. Can be used to cancel the closing via the set_cancel(shouldCancel)
method of the event arguments object.
you can obtain this object via the get_argument() method of the event arguments object. Useful in dialog scenarios when closing the RadWindow from its content page.
OnClientDragStart - called when the user starts dragging the window.
OnClientDragEnd - called after a drag operation ends.
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).
Its event arguments object provides the get_commandName() method which returns the name of the command that was just fired. It can also be cancelled via the
The Client-side events are raised in the page where the RadWindow's markup resides, regardless of the window object that initiated its opening. If you are
opening a RadWindow from within a RadWindow the second one's events can be directly consumed
in the parent page, not in the first dialog.
The following example illustrates how client-side events work.
Drag a RadWindowManager object from the toolbox onto your form.
Use the Windows property to bring up the RadWindow Collection Editor.
Add two RadWindow objects, giving them ID values of "RadWindow1" and "RadWindow2", respectively. Then Click Ok to close the editor.
Go to the source view, and add the following code to the markup of your page:
function OnClientCommand(sender, eventArgs)
logEvent("<strong>OnClientCommand</strong>: Command is " + eventArgs.get_commandName());
function OnClientResizeEnd(sender, eventArgs)
logEvent("<strong>OnClientResizeEnd</strong>: RadWindow is resize ended");
function OnClientResizeStart(sender, eventArgs)
logEvent("<strong>OnClientResizeEnd</strong>: RadWindow is resize started");
function OnClientDragStart(sender, eventArgs)
logEvent("<strong>OnClientDragStart</strong>: RadWindow drag started");
function OnClientDragEnd(sender, eventArgs)
logEvent("<strong>OnClientDragEnd</strong>: RadWindow drag ended");
function OnClientPageLoad(sender, eventArgs)
logEvent("<strong>OnClientPageLoad</strong>: RadWindow completed loading the page");
function OnClientActivate(sender, eventArgs)
function OnClientBeforeClose(sender, eventArgs)
logEvent("<strong>OnClientBeforeClose</strong>: RadWindow is closing.");
function OnClientclose(sender, eventArgs)
$get("Button1").disabled = false;
var arg = eventArgs.get_argument();
radalert("A custom argument was passed. Its value is: " + arg);
logEvent("<strong>OnClientClose</strong>: The RadWindow is closed with an argument. The provided argument is: " + arg);
logEvent("<strong>OnClientClose</strong>: RadWindow is closed");
function OnClientshow(sender, eventArgs)
$get("Button1").disabled = true;
logEvent("<strong>OnClientShow</strong>: RadWindow is shown.");
function OnClientBeforeShow(sender, eventArgs)
logEvent("<strong>OnClientBeforeShow</strong>: RadWindow is showing.");
function OnClientAutoSizeEnd(sender, eventArgs)
logEvent("<strong>OnClientAutoSizeEnd</strong>: RadWindow is autosized.");
var d = new Date();
var dateStr = d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds();
document.getElementById("eventConsole").innerHTML = "[" + dateStr + "] " + eventString + "<br/>" + document.getElementById("eventConsole").innerHTML;
Select the RadWindowManager object and set the following properties:
Set the OnClientCommand property to "OnClientCommand".
Set the OnClientResizeStart property to "OnClientResizeStart".
Set the OnClientResizeEnd property to "OnClientResizeEnd".
Set the OnClientAutoSizeEnd property to "OnClientAutoSizeEnd".
Set the OnClientDragStart property to "OnClientDragStart".
Set the OnClientDragEnd property to "OnClientDragEnd".
Set the OnClientActivate property to "OnClientActivate".
Set the OnClientPageLoad property to "OnClientPageLoad".
Set the OnClientBeforeClose property to "OnClientBeforeClose".
Set the OnClientClose property to "OnClientClose."
Set the OnClientShow property to "OnCLientShow".
Set the OnClientBeforeShow property to "OnClientBeforeShow".
Open the RadWindow Collection Editor again, and set the OpenerElementId property of RadWindow1 to "link1" and the OpenerElementId property of RadWindow2 to "link2".
Run the application. Play with the windows, clicking the links to open them, dragging them around, resizing them, minimizing, maximizing or pinning them, etc: