This example shows how to delete selected nodes.
The image below shows the result:
To learn more, see Adding and Deleting Nodes.
using DevExpress.Web.ASPxTreeList;
protected void Page_Load(object sender, EventArgs e) {
ASPxTreeList1.SettingsEditing.AllowRecursiveDelete = true;
}
protected void ASPxTreeList1_CustomCallback(object sender,
TreeListCustomCallbackEventArgs e) {
foreach (TreeListNode node in ASPxTreeList1.GetSelectedNodes())
ASPxTreeList1.DeleteNode(node.Key);
ASPxTreeList1.DataBind();
}
Imports DevExpress.Web.ASPxTreeList
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
ASPxTreeList1.SettingsEditing.AllowRecursiveDelete = True
End Sub
Protected Sub ASPxTreeList1_CustomCallback(ByVal sender As Object, _
ByVal e As TreeListCustomCallbackEventArgs)
For Each node As TreeListNode In ASPxTreeList1.GetSelectedNodes()
ASPxTreeList1.DeleteNode(node.Key)
Next node
ASPxTreeList1.DataBind()
End Sub
<dxe:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False"
CssFilePath="~/App_Themes/Glass/{0}/styles.css"
CssPostfix="Glass" OnClick="ASPxButton1_Click" Text="Delete Selected"
EnableClientSideAPI="True">
<ClientSideEvents Click="function(s, e) {
treeList.PerformCallback('');
}" />
</dxe:ASPxButton>