Back to Devexpress

How to: Create Custom Command Buttons

aspnet-4674-components-tree-list-examples-how-to-create-custom-command-buttons.md

latest1.0 KB
Original Source

How to: Create Custom Command Buttons

  • Dec 17, 2020

This example shows how to create and customize a custom command button.

To create and customize a custom button at design-time, invoke the editor used to manage the TreeListCommandColumn.CustomButtons collection:

You can specify the button’s text, image and in which nodes the custom button is displayed. In this example, the custom button is displayed within a browsable node.

To define an action, handle the client ASPxClientTreeList.CustomButtonClick event.

javascript
<ClientSideEvents CustomButtonClick="function(s, e) {
    alert(&quot;A custom button has been clicked.&quot;);
}" />

The below shows the result: