aspx界面设置
<dx:ASPxTreeList ID="treeList" runat="server" AutoGenerateColumns="False" KeyFieldName="CategoryId"
Width="100%" ParentFieldName="ParentId" ClientInstanceName="treeList" OnNodeDeleting="TreeList_NodeDeleting"
OnNodeInserting="TreeList_NodeInserting" OnNodeUpdating="TreeList_NodeUpdating"
OnCellEditorInitialize="TreeList_CellEditorInitialize" OnNodeValidating="TreeList_NodeValidating"
OnHtmlDataCellPrepared="treeList_HtmlDataCellPrepared" OnCommandColumnButtonInitialize="treeList_CommandColumnButtonInitialize"
>
<Columns>
<dx:TreeListDataColumn FieldName="Name" Caption="名称">
</dx:TreeListDataColumn>
<dx:TreeListComboBoxColumn FieldName="Status" Caption="类型">
</dx:TreeListComboBoxColumn>
<dx:TreeListCommandColumn Caption="编辑功能">
<EditButton Visible="true" Text="编辑">
</EditButton>
</dx:TreeListCommandColumn>
<dx:TreeListCommandColumn Caption="新建功能">
<NewButton Visible="true" Text="新建">
</NewButton>
</dx:TreeListCommandColumn>
<dx:TreeListCommandColumn Caption="删除功能">
<DeleteButton Visible="true" Text="删除">
</DeleteButton>
</dx:TreeListCommandColumn>
</Columns>
<SettingsEditing Mode="PopupEditForm" />
<SettingsPopupEditForm Caption="编辑" Width="500" Modal="true" HorizontalAlign="Center"
VerticalAlign="WindowCenter" />
<SettingsBehavior AllowFocusedNode="True" AllowDragDrop="false" ProcessSelectionChangedOnServer="false" />
<Settings ShowTreeLines="true" GridLines="Horizontal" />
<SettingsText CommandEdit="编辑" RecursiveDeleteError="该节点有子节点,不能删除" CommandNew="新建资源"
ConfirmDelete="确定要删除吗?" CommandUpdate="更新" CommandDelete="删除" CommandCancel="取消" />
</dx:ASPxTreeList> RecursiveDeleteError属性:当点击删除链接时,控件会自动判断是否有子节点,如有则给与提示并不触发删除事件