Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个导致IGrouping<Users, string> 的 linq2sql 查询,我想将它绑定到 ListView:
IGrouping<Users, string
<ListView Name="UsersListView"> <ListView.View> <GridView> <GridView.Columns> </GridView.Columns> </GridView> </ListView.View> </Listview>
我怎样才能做到这一点?
你应该CollectionViewSource像Page.REsources下面这样。并绑定你CollectionViewSource 的重要的是IsSourceGrouped = true
CollectionViewSource
Page.REsources
IsSourceGrouped = true
<Page.Resources> <ResourceDictionary> <CollectionViewSource x:Name="groupedData" IsSourceGrouped="true" Source="{Binding GroupedData}" /> </Page.Resources>