使用DB表中的根节点和父节点填充Treeview [英] Populate Treeview with just root and parent nodes from a DB table

查看:85
本文介绍了使用DB表中的根节点和父节点填充Treeview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库表。表名:零件列:'PartId','name'。该表将始终获得新条目。我想使用这个表行填充treeview。树视图将有一个根节点和只有父节点(表的行)。



-Part

-sub1(第1行)

-sub2(第2行)

-sub3(第3行)

...

这里没有子节点。我发现很多文章讨论了使用两个表(父节点和子节点)创建树视图,但没有找到任何用于执行上述操作的示例(仅创建父节点)。请通过提供正在讨论实现上述内容的链接或从此开始的示例代码来帮助我。

I have a DB Table. Table Name:Parts Columns:'PartId','name'. This table will always be getting new entries. I want to populate treeview using this tables rows. Tree view will have one 'root' node and only parent nodes(rows of table).

-Part
-sub1(row1)
-sub2(row2)
-sub3(row3)
...
No child nodes here. I have found many articles discussing about creating tree view using two tables(parent and child nodes) but didn't find any examples for doing the above(creating only parent nodes). Please help me by providing the links that are discussing to implement the above or a sample code to start on this.

推荐答案

好在这里


这篇关于使用DB表中的根节点和父节点填充Treeview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆