Failed to Compare two elments in a array.

最近遇到一个奇怪的问题,是第三方控件Third Party的问题,

Failed to Compare two elments in a array.

System.InvalidOperationException: Failed to compare two elements in the array. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Infragistics.Win.ValueListItemsCollection.ValueListComparer.Compare(Object o1, Object o2)
   at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer)
   --- End of inner exception stack trace ---
   at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer)
   at System.Collections.ArrayList.BinarySearch(Int32 index, Int32 count, Object value, IComparer comparer)
   at System.Collections.ArrayList.BinarySearch(Object value, IComparer comparer)
   at Infragistics.Win.ValueListItemsCollection.IndexOf(Object valueListItem)
   at Infragistics.Win.ValueList.set_SelectedItem(Object value)
   at K2.Mod.Core.DocumentOrganiseEdit.PopulateDropDown() in D:\K2Development\K2\K2.Mod.Core\Document Organiser\DocumentOrganiseEdit.cs:line 431
   at K2.Mod.Core.DocumentOrganiseEdit.InitializeData() in D:\K2Development\K2\K2.Mod.Core\Document Organiser\DocumentOrganiseEdit.cs:line 345
   at K2.Mod.Core.DocumentOrganiseEdit.DocumentOrganiseEdit_Shown(Object sender, EventArgs e) in D:\K2Development\K2\K2.Mod.Core\Document Organiser\DocumentOrganiseEdit.cs:line 80

网上搜了下是因为没有实现IComparable接口。

转载于:https://www.cnblogs.com/shenfengok/archive/2012/07/27/2611670.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值