当子节点的数据源来自sql数据库表时,如何动态地将子节点添加到C#wpf中的树视图项 [英] How do you dynamically add a child node to a treeview item in C# wpf when the data source of the child node is from a sql database table

查看:77
本文介绍了当子节点的数据源来自sql数据库表时,如何动态地将子节点添加到C#wpf中的树视图项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当子节点的数据源来自sql数据库表时,如何动态地将子节点添加到C#wpf中的树视图项目







谢谢

"How do you dynamically add a child node to a treeview item in C# wpf when the data source of the child node is from a sql database table
":


Thanks

推荐答案

看到这是一些有用的链接:

http:// wpf-4-0。 blogspot.in/2013/01/treeview-dynamically-add-items-in-wpf-c.html [ ^ ]

http://www.c-sharpcorner.com/uploadfile/mahesh/treeview-in-wpf/ [< a href =http://www.c-sharpcorner.com/uploadfile/mahesh/treeview-in-wpf/\"target =_ blanktitle =新窗口> ^ ]

简化WP使用ViewModel模式的F TreeView [ ^ ]



您可以做的是首先触发 SELECT查询(可能是按钮点击或特定时间间隔,即使用线程)和所需数据,您可以动态生成节点以及如何执行此操作,这在所有这些链接中都有说明。



祝你好运:)
See this are some useful links :
http://wpf-4-0.blogspot.in/2013/01/treeview-dynamically-add-items-in-wpf-c.html[^]
http://www.c-sharpcorner.com/uploadfile/mahesh/treeview-in-wpf/[^]
Simplifying the WPF TreeView by Using the ViewModel Pattern[^]

What you can do is first fire the SELECT query (may be on Button Click or on specific time interval i.e using Threads) and with the desired data you can dynamically generate the nodes and how to do that, that is explained in all these links.

Good Luck :)


这篇关于当子节点的数据源来自sql数据库表时,如何动态地将子节点添加到C#wpf中的树视图项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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