我使用PostSharp和RadGridView从Telerik的。某些列有使用DataTypeConverter,其中我使用加载从类型Name
的命名AdvisableDictionary<Tkey, TValue>
属性的值自定义数据。
网格具有过滤器按钮,点击会显示与类似于Excel的过滤选项的弹出窗口时。
然而,当我点击这个按钮,我得到一个错误说Failed to compare two elements in the array.
出现这种情况仅适用于这种类型的数据的列。我没有与PostSharp太多的经验,但我认为这是由PostSharp产生。
下面是从PostSharp输出窗口的最后几行,它会抛出异常之前:
The thread 0x3964 has exited with code 0 (0x0).
The thread 0x364 has exited with code 0 (0x0).
Step into: Stepping over non-user code 'TranslatableObject.get_Name'
Step into: Stepping over non-user code 'TranslatableObject.<Name>c__Binding1.GetValue'
Step into: Stepping over non-user code 'TranslatableObject.<Name>c__Binding1.get_LocationInfo'
Step into: Stepping over non-user code 'TranslatableObject.<Name>c__Binding.GetValue'
我能做些什么来解决这个问题?
我想出了一个解决方案:AdvisableDctionary
没有实现IComparable用来排序的项目列表。
我创建了一个类继承AdvisableDictionary
和实施IComparable
,并在过滤器弹出的FilterConfirmed
事件。
我纠正了过滤器描述符的值。