ASTreeView到DataTable

时间:2017-06-20 11:53:17

标签: c# xml datatable

在我的一个项目中,我正在测试ASTreeView Link

我已在我的项目中成功实施了它。当我完成重新排列节点时,我想从树形视图获取数据到DataTable,但项目只允许导出到XML。

树和生成的XML示例:

tree

<astreeview>
   <astreeview-nodes>
        <astreeview-node node-text="node1" node-value="1" node-type="0" checked-state="2" open-state="0" selected="false" enable-edit-context-menu="true" enable-delete-context-menu="true" enable-add-context-menu="true" node-icon="" enable-drag-drop="true" enable-siblings="true" enable-children="true" enable-checkbox="true" enable-selection="true" enable-open-close="true" />
        <astreeview-node node-text="node2" node-value="2" node-type="0" checked-state="2" open-state="0" selected="false" enable-edit-context-menu="true" enable-delete-context-menu="true" enable-add-context-menu="true" node-icon="" enable-drag-drop="true" enable-siblings="true" enable-children="true" enable-checkbox="true" enable-selection="true" enable-open-close="true">
          <astreeview-nodes>
            <astreeview-node node-text="node2_1" node-value="4" node-type="0" checked-state="2" open-state="0" selected="false" enable-edit-context-menu="true" enable-delete-context-menu="true" enable-add-context-menu="true" node-icon="" enable-drag-drop="true" enable-siblings="true" enable-children="true" enable-checkbox="true" enable-selection="true" enable-open-close="true">
            </astreeview-node>
            <astreeview-node node-text="node2_2" node-value="8" node-type="0" checked-state="2" open-state="0" selected="false" enable-edit-context-menu="true" enable-delete-context-menu="true" enable-add-context-menu="true" node-icon="" enable-drag-drop="true" enable-siblings="true" enable-children="true" enable-checkbox="true" enable-selection="true" enable-open-close="true" />
          </astreeview-nodes>
        </astreeview-node>  <astreeview-node node-text="node3" node-value="3" node-type="0" checked-state="2" open-state="0" selected="false" enable-edit-context-menu="true" enable-delete-context-menu="true" enable-add-context-menu="true" node-icon="" enable-drag-drop="true" enable-siblings="true" enable-children="true" enable-checkbox="true" enable-selection="true" enable-open-close="true">
          <astreeview-nodes>
            <astreeview-node node-text="node3_1" node-value="32" node-type="0" checked-state="2" open-state="0" selected="false" enable-edit-context-menu="true" enable-delete-context-menu="true" enable-add-context-menu="true" node-icon="" enable-drag-drop="true" enable-siblings="true" enable-children="true" enable-checkbox="true" enable-selection="true" enable-open-close="true"/>
          </astreeview-nodes>
        </astreeview-node>
    </astreeview-nodes>
 </astreeview>

我需要在DataTable中输出每个节点的以下数据:  节点文本|节点值|节点的父。

我怎样才能做到这一点?

0 个答案:

没有答案