首页 新闻 会员 周边

CollectionView不能排序

0
[待解决问题]

现在有一个抽象类用到这个对象,但是需要排序,请指导一下,怎么做才能排序?

Mike94的主页 Mike94 | 菜鸟二级 | 园豆:206
提问于:2014-11-06 15:25
< >
分享
所有回答(1)
0
  • A CollectionView is created if your source implements IEnumerable. If the source implements IEnumerable *only*, you will not be able to sort or group the collection (you can only filter it). Also, perf will not be the best if the source has a large number of items or if you perform dynamic operations such as insertions and deletions. If this is your scenario, you should consider having your source implement a stronger interface. ICollection is slightly better because it provides a Count property.

解决方案你自己看下面这篇文章吧。

How to add custom sorting logic

爱编程的大叔 | 园豆:30844 (高人七级) | 2014-11-06 15:43

如果是Custom Sorting就试试吧,我试过重写属性也不行的,不知道为什么,自定义排序好麻烦

支持(0) 反对(0) Mike94 | 园豆:206 (菜鸟二级) | 2014-11-06 16:34
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册