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

OnCommand

The OnCommand client-side event handler is called when a command is about to be executed.

Two parameters are passed to the event handler:

  • sender - the RadDataForm control that fired the event

  • eventArgs - an event arguments object of type Telerik.Web.UI.DataFormCommandEventArg. It has the following methods:

NameParametersReturn TypeDescription
get_commandNameStringReturns the name of the initiated command.
get_commandArgumentStringReturns the argument of the initiated command, which will be passed to the server.

The following example illustrates how you can handle the OnCommand event and retrieve the command name and argument:

ASPNET
<telerik:RadDataForm RenderMode="Lightweight" runat="server" ID="RadDataForm2">
    <ClientSettings>
        <ClientEvents OnCommand="onCommand" />
    </ClientSettings>
</telerik:RadDataForm>
JavaScript
<script type="text/javascript">
    function onCommand(sender, args) {
        var commandName = args.get_commandName();
        var commandArgument = args.get_commandArgument();

    }
</script>
Not finding the help you need?
Contact Support