WPF 树列表视图
我想知道是否有人知道如何在 WPF/XAML/Expression Blend 中使用 TreeListView
。不使用后面的代码。
这就是我想做的。我想用信息填充 TreeListView
,如果信息的客户端和内容相同,则只需将该项目作为其子项即可。
示例:
客户 1= Kevin,事情 = Cook,时间 =5 客户 2 = 约翰,事情 = 程序,时间 = 4 客户 3 = Sam,事情 = 运行,时间 =9 客户 4 = Kevin,Matter = Cook,时间 = 7
问题将如下所示 - 和 + 是树列表视图的扩展
- Kevin Cook 5 Kevin Cook 7 John Program 4 Sam Run 9
我正在从数据库中检索所有信息。我当前的问题是,我无法将孩子添加到我的树列表中。我想知道是否有人知道如何在不进行硬编码的情况下做到这一点? 我查看了 HierarchicalDataTemplate
,但其中没有太多信息。任何帮助将不胜感激!
I was wondering if anyone knows how to use the TreeListView
in WPF/XAML/Expression Blend. Without using the code behind.
This what I want to do. I would like to populate a TreeListView
with information, if the information's client and matter are the same, then just make that item a child of it.
Example:
Client 1= Kevin, Matter = Cook, Time =5
Client 2 = John, Matter = Program, Time = 4
Client 3 = Sam, Matter = Run, Time =9
Client 4 = Kevin, Matter = Cook, Time=7
The problem will look like this
the - and + is the expansion of the tree list view
- Kevin Cook 5 Kevin Cook 7 John Program 4 Sam Run 9
I am retrieving all the information from a database. My current problem is, I can't add a children into my treelist. I was wondering if anyone knows how to do this without hard coding?
I looked into the HierarchicalDataTemplate
, but there was not much information in it. Any help would be greatly appreciated!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
..这个链接有帮助吗?
在 WPF 中构建树视图
好的..那么您可以精确地按层次结构排列数据吗您想要查看的方式。
就像,我们有所有“独特”条目的集合(客户和事项都是独特的)。所有这些独特的条目将具有其他“重复”条目(匹配客户和事项)。
.. and does this link help?
Build a treeview in WPF
OK.. so can you arrange your data in exactly the hierarchical manner that you want to view it.
Like, we have a collection of all the "unique" entries (client and matter are unique). All these unique entries will have other "duplicate" entries (matching client and matter).
使用与entitySource类似的对象之一并配置该对象的数据源以了解如何应用该数据。
Use one of the objects similiar to entitySource and configure the datasource of the object to know how to apply that data.