开发者

ListView and IGrouping

I have a linq2sql query that results in an IGrouping<Users, string>, that I want to bind to a ListView:

<ListView Name="UsersListView">
  <ListView.View>
    <GridView>
      <GridView.Columns>
      </GridView.Columns>开发者_C百科;
    </GridView>
  </ListView.View>
</Listview>

How can I do this?


You should make CollectionViewSource in Page.REsources like below. And bind your CollectionViewSource The important thing is that IsSourceGrouped = true

<Page.Resources>
    <ResourceDictionary>            
        <CollectionViewSource x:Name="groupedData" IsSourceGrouped="true" Source="{Binding GroupedData}" />
</Page.Resources>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜