L 1 16.1 12/2/2012 L 2 17.4 3/14/2011 R 3 8.2 5/15/2012 R 4 9.0 10/19/2012 不确定上面的网格会出现多少,但是我需要A列和B列始终保留在用户对列C和D进行排序时的顺序。列C和D将一起排序I need to create a grid with a list of objects as the datasource -- very basic. I also need to add 2 columns that are always fixed. So when the user sorts on one of the columns from the list of objects these 2 columns never sort. Similar to a Sort in Excel after selecting the sort range.Example:A B C DL 1 16.1 12/2/2012L 2 17.4 3/14/2011R 3 8.2 5/15/2012R 4 9.0 10/19/2012Not sure how well the above grid will show up, but I need columns A and B to always remain in that order while the user sorts columns C and D. Columns C and D will sort together推荐答案看起来你需要一个自定义排序算法,所以看看这里: http://www.zagstudio.com/blog/441#.UU3IDjetqDw [ ^ ] 虽然我的问题可能不对。Seems like you need a custom sorting algorithm, so have a look here:http://www.zagstudio.com/blog/441#.UU3IDjetqDw[^]Although I might got your question wrong. 这篇关于在WPF数据网格中排序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-03 13:50