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

Custom Commands

You can implement custom commands for handling the records of the TreeList.

To include a command column which will render a button for triggering the command in the column cells:

  1. Add a custom command column by using the column definition.

    Razor
        .Columns(columns =>
        {
            columns.Add().Width(300).Command(c =>
            {
                c.Custom().Name("details").Text("View Details").Click("showDetails");
            });
        })
  2. Wire the click event of the button to a JavaScript function which will receive the corresponding TreeList data item as an argument. In the function definition, handle the command.

    Razor
     <script type="text/javascript">
         function showDetails(e) {
             alert("Custom command button clicked!");
         }
     </script>

See Also

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