Skip to main content
A newer version of this page is available. .

TreeListSettingsEditing.AllowRecursiveDelete Property

Gets or sets whether parent nodes can be deleted.

Namespace: DevExpress.Web.ASPxTreeList

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

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(false)]
public bool AllowRecursiveDelete { get; set; }

Property Value

Type Default Description
Boolean **false**

true to allow deleting parent nodes within their children; false only child nodes (not parent) can be deleted.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to AllowRecursiveDelete
ASP.NET Controls and MVC Extensions ASPxTreeList
.SettingsEditing .AllowRecursiveDelete
ASP.NET MVC Extensions MVCxTreeList
.SettingsEditing .AllowRecursiveDelete
TreeListSettings
.SettingsEditing .AllowRecursiveDelete
TreeListSettings<RowType>
.SettingsEditing .AllowRecursiveDelete

Remarks

If the AllowRecursiveDelete option is disabled, an error message is displayed when deleting a parent node. To change the error text, use the TreeListSettingsText.RecursiveDeleteError property.

RecursiveDelete

To learn more, see Adding and Deleting Nodes.

Example

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