Best way to make WPF ListView/GridView sort on column-header clicking?

前端 未结 10 1132
感动是毒
感动是毒 2020-11-29 17:12

There are lots of solutions on the internet attempting to fill this seemingly very-basic omission from WPF. I\'m really confused as to what would be the \"best\" wa

10条回答
  •  渐次进展
    2020-11-29 18:13

    It all depends really, if you're using the DataGrid from the WPF Toolkit then there is a built in sort, even a multi-column sort which is very useful. Check more out here:

    Vincent Sibals Blog

    Alternatively, if you're using a different control that doesn't support sorting, i'd recommend the following methods:

    Li Gao's Custom Sorting

    Followed by:

    Li Gao's Faster Sorting

提交回复
热议问题