PostSharp get_Property错误

问题描述 投票:1回答:2

我使用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'

我能做些什么来解决这个问题?

c# dictionary telerik postsharp radgridview
2个回答
0
投票

你可以创建一个类继承AdvisableDictionary和实现IComparable。

public class AdvisableDictionary: IComparable
{
    //here add the code from your heart
}

HERE 1

HERE 2

因此,它在FilterPopup的FilterConfirmed事件简单,你需要正确的过滤器描述符的值。

而已。

下面是一个示例prj。请看一下。有乐趣享受C#编程。

这是我的解决方案,需要尝试,是一个老板,要努力,要快乐:)


-1
投票

我想出了一个解决方案:AdvisableDctionary没有实现IComparable用来排序的项目列表。

我创建了一个类继承AdvisableDictionary和实施IComparable,并在过滤器弹出的FilterConfirmed事件。

我纠正了过滤器描述符的值。

© www.soinside.com 2019 - 2024. All rights reserved.