• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
路过的世界
释迦摩尼说过:众生皆有如来佛生相,求佛求人不如求己。
博客园    首页    新随笔    联系   管理    订阅  订阅

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接口。

posted @ 2012-07-27 13:46  路过的世界  阅读(1721)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3