如何过滤或搜索TreeView? [英] How to filtering or search a TreeView?
问题描述
大家好,
我有一个关于使用TreeView.Items.Filter
属性或类似内容在WPF下的TreeView
中过滤TreeViewItems
的问题,我还阅读了Pro WPF in C#
本书的Filtering Collections
部分中的问题并在互联网上进行了研究,但是可以''无法获得理想的结果.
好了,在我的XAML代码中有一个TreeView和一个TextBox,在TreeView中有许多嵌套的TreeViewItem.
Hi guys,
I have a problem about filtering TreeViewItems
in TreeView
under WPF using TreeView.Items.Filter
property or stuff like this, I also read around the issue in Filtering Collections
section of Pro WPF in C#
book and research on internet, but can''t get ideal result.
Alright there is a TreeView and a TextBox in my XAML code, in the TreeView is many nested TreeViewItem.
<TreeView>
<TreeViewItem Header="root" IsExpanded="True">
<TreeViewItem Header="h1">
<TreeViewItem Header="h11" />
<TreeViewItem Header="h12" />
</TreeViewItem>
<TreeViewItem Header="h2">
<TreeViewItem Header="h21" />
<TreeViewItem Header="h22">
<TreeViewItem Header="k1">
<TreeViewItem Header="k11" />
<TreeViewItem Header="k12"/>
</TreeViewItem>
</TreeViewItem>
</TreeViewItem>
</TreeViewItem>
</TreeView>
我想显示/过滤在TextBox中包含术语的TreeViewItems.请说出您的观点?
预先感谢.
I want to show/filtering TreeViewItems that contain a term of in the TextBox. Please say me your point of view?
Thanks in advance.
推荐答案
http://www.hardcodet.net/2008/02/programmatically-filtering-the-wpf-treeview [ http://www.telerik.com/community/forums/wpf/treeview/filter-in-treeview.aspx [ ^ ]
http://social.msdn.microsoft.com/Forums/zh/wpf/thread/4a013976-b7ec-4cbe-90aa-51488b852cd5 [ http://stackoverflow.com/questions/1526662/wpf- [ http://stackoverflow.com/questions/1313325/how-to-filter-a-wpf-treeview-hierarchy-using-i-collectionview [ http://www.telerik. com/community/forums/wpf/treeview/how-to-implement-search-or-filter-in-radtreeview.aspx [ http://social.msdn.microsoft.com/论坛/en-US/wpf/thread/85843039-420d-46d2-ba1d-248322f8ea17 [
http://www.hardcodet.net/2008/02/programmatically-filtering-the-wpf-treeview[^]
http://www.telerik.com/community/forums/wpf/treeview/filtering-in-treeview.aspx[^]
http://social.msdn.microsoft.com/Forums/en/wpf/thread/4a013976-b7ec-4cbe-90aa-51488b852cd5[^]
http://stackoverflow.com/questions/1526662/wpf-filtering-searching-multiple-collection-views-within-a-treeview[^]
http://stackoverflow.com/questions/1313325/how-to-filter-a-wpf-treeview-hierarchy-using-an-icollectionview[^]
http://www.telerik.com/community/forums/wpf/treeview/how-to-implement-search-or-filter-in-radtreeview.aspx[^]
http://social.msdn.microsoft.com/forums/en-US/wpf/thread/85843039-420d-46d2-ba1d-248322f8ea17[^]
这篇关于如何过滤或搜索TreeView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!