New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Client-Side Events Overview

RadImageEditor provides a rich set of client-side events which allow easy and flexible use in a wide range of application scenarios. Many of the events are cancelable giving you the possibility to cancel any operation performed on the image:

To use these events, simply write a javascript function that can be called when the event occurs. Then assign the name of the javascript function as the value of the the corresponding property.

ASP.NET
<telerik:RadImageEditor RenderMode="Lightweight" runat="server" ID="RadImageEditor1" OnClientLoad="OnClientLoad"></telerik:RadImageEditor>
<script type="text/javascript">
    function OnClientLoad(sender, eventArgs)
    {
        alert("OnClientLoad event fired by RadImageEditor with ID: " + sender.get_id());
    }
</script>

You can also assign event handlers in client-side code. When using the client-side API, pass a reference to the event handler rather than its name. One advantage of using the client-side API is that you can attach multiple event handlers to one event using the standard MS AJAX convention:

JavaScript
function addEvents()
{
    var radImageEditor1 = $find("<%= RadImageEditor1.ClientID%>");
    radImageEditor1.add_commandExecuting(function1);
    radImageEditor1.add_commandExecuting(function2);
}

Another advantage of the client-side API is that you can detach an event handler dynamically:

JavaScript
function removeEvents()
{
    var radImageEditor1 = $find("<%= RadImageEditor1.ClientID%>");
    radImageEditor1.remove_commandExecuting(function1);
}

Here is a list with the available methods to attach or detach event handlers:

NameDescription
add_loadAdds a handler to the OnClientLoad event
remove_loadRemoves a handler from the OnClientLoad event
add_commandExecutingAdds a handler to the OnClientCommandExecuting event
remove_commandExecutingRemoves a handler from the OnClientCommandExecuting event
add_commandExecutedAdds a handler to the OnClientCommandExecuted event
remove_commandExecutedRemoves a handler from the OnClientCommandExecuted event
add_imageChangingAdds a handler to the OnClientImageChanging event
remove_imageChangingRemoves a handler from the OnClientImageChanging event
add_imageChangedAdds a handler to the OnClientImageChanged event
remove_imageChangedRemoves a handler from the OnClientImageChanged event
add_resizeStartAdds a handler to the OnClientResizeStart event
remove_resizeStartRemoves a handler from the OnClientResizeStart event
add_resizeEndAdds a handler to the OnClientResizeEnd event
remove_resizeEndRemoves a handler from the OnClientResizeEnd event
add_savingAdds a handler to the OnClientSaving event
add_shortCutHitAdds a handler to the shortCutHit event
remove_savingRemoves a handler from the OnClientSaving event
remove_shortCutHitRemoves a handler from the shortCutHit event
add_savedAdds a handler to the OnClientSaved event
remove_savedRemoves a handler from the OnClientSaved event
add_toolsDialogClosedAdds a handler to the OnClientToolsDialogClosed event
remove_toolsDialogClosedRemoves a handler from the OnClientToolsDialogClosed event

See Also

In this article
See Also
Not finding the help you need?
Contact Support