# 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 HtmlHelper
       .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.

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

## See Also

* [Server-Side API](https://www.telerik.com/aspnet-mvc/documentation/api/treelist)
