WPF Datagrid group and sort

后端 未结 3 1178
轮回少年
轮回少年 2021-01-06 15:49

I am implementing grouping in WPF datagrid. I want to sort the grouped items. For example datagrid is having four columns(empno,name,dept,address). I am doing grouping by de

3条回答
  •  隐瞒了意图╮
    2021-01-06 16:28

    Have you seen the MSDN article How to: Sort a GridView Column When a Header Is Clicked which refers to the sample from ListView That Sorts Data Sample and the latter has (Download sample) link

    Funny but the eventual reference to sample download is available only through .NET 3.0 and 3.5 version of the MSDN article but not through versions for .NET 4.0 and 4.5 though the code snippets are the same.

    There are also bog articles with samples based on above MSDN sample:

    • Thomas Levesque's [WPF] Automatically sort a GridView when a column header is clicked
    • Thomas Levesque's [WPF] Automatically sort a GridView (continued)
      The latter also has a code

    There is also MSDN blog articles with runnable Visual Studio project (with depemnency on WPF Toolkit) :

    • WPF DataGrid: Tri-state Sorting sample
    • Improving Microsoft DataGrid CTP sorting performance

提交回复
热议问题