Multilevel GridView in WPF
I have been trying to search frantically for Nesting GridViews(4 levels). I have used Rowdetailstemplate for 2 levels for a different view but not beyond it. Many articles have gridview inside a TreeView which is ok but I need my inner elements to have headers too. 开发者_JAVA百科Something like this(http://www.codeproject.com/KB/webforms/MasterDetail.aspx)
Many articles have gridviews inside treeview but with no headers. In this at eachlevel I want to add headers. Any help appreciated.
There are special tools for it in WPF, and they are the ListCollectionView
and the BindingListCollectionView
, both declared as CollectionViewSource
.
Please take a look here, I am sure it will help you a lot.
In short, it should be declared:
<CollectionViewSource x:Key="BlogsCollection" Source="{Binding Blogs}" />
<CollectionViewSource x:Key="ArticlesCollection"
Source="{Binding Articles, Source={StaticResource BlogsCollection}}" />
I used it with a case like yours but I my DG's SelectionMode was set to one row, and it worked fine, donn't how it will behave in multiselection, but I am sure it could be worked out (maybe by setting the staticresource inside the details etmplate).
精彩评论