ASPxTreeList.DeleteNode(String) Method

Deletes the specified node.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v19.2.dll

Declaration

public void DeleteNode(
    string nodeKey
)
Public Sub DeleteNode(
    nodeKey As String
)

Parameters

Name Type Description
nodeKey String

A string value that identifies the node.

Remarks

Once the DeleteNode method is called, the ASPxTreeList.NodeDeleting event is raised. It allows you to cancel the delete operation. After a node has been deleted, the ASPxTreeList.NodeDeleted event is raised.

End-users can delete nodes using the Delete button.

To learn more, see Adding and Deleting Nodes.

Examples

This example shows how to delete selected nodes.

The image below shows the result:

exDeleteSelectedNodes

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();
}
See Also