我正在使用 Telerik GridView,并且在尝试对列进行排序时遇到问题它由 List<> 组成。在此论坛条目中, Telerik 团队表示,网格可以对 IComparable 进行排序并对 IEquatable<> 进行分组/过滤。无论 Silverlight 版本如何。在下面的 xaml 中,您将看到网格中的四列。 SVO 专栏是我遇到问题的专栏。 SVO 绑定到列表 (ServiceOrder_DataViewModel)。由于列表未实现 IComparable 或 IEquatable,因此我无法对该列进行排序或分组/过滤。所以,我的问题是:如何创建一个实现 IComparable 和 IEquatable 的新 List 对象?我们确实有逻辑能够实现 IComparable 和 IEquatable,我只是不确定如何实现它。任何帮助将不胜感激!
<d:MVVMRadGridView.Columns>
<telerikGridView:GridViewDataColumn Header="Case Id" UniqueName="Id" CellTemplate="{StaticResource CaseIDLinkCellTemplate}" DataMemberBinding="{Binding Id}" DisplayIndex="0" IsVisible="True" />
<telerikGridView:GridViewDataColumn Header="SVOs" UniqueName="SVOs" CellTemplate="{StaticResource CaseServiceOrdersLinksCellTemplate}" DisplayIndex="1" IsVisible="True" TextWrapping="Wrap" />
<telerikGridView:GridViewDataColumn Header="Type" UniqueName="Type" DataMemberBinding="{Binding Type}" DisplayIndex="2" IsVisible="True" TextWrapping="Wrap" />
<telerikGridView:GridViewDataColumn Header="Status" UniqueName="Status" DataMemberBinding="{Binding Status}" DisplayIndex="3" IsVisible="True" />
</d:MVVMRadGridView.Columns>
I am using a Telerik GridView, and having an issue trying to sort a column that is made of of a List<>. In this forum entry, the Telerik team states that the grid can sort IComparable and group/filter IEquatable<> no matter of the Silverlight version. In the xaml below, you will see the four columns that I have in my grid. The SVOs column is the one that I'm having the issue with. SVOs is bound to a List(ServiceOrder_DataViewModel). Since a List does not implement IComparable or IEquatable, I cannot sort or group/filter this column. So, my question is: how do I create a new List object that implements IComparable and IEquatable? We do have logic to be able to implement the IComparable and IEquatable, I'm just not sure how to implement it. Any help would be greatly appreciated!
<d:MVVMRadGridView.Columns>
<telerikGridView:GridViewDataColumn Header="Case Id" UniqueName="Id" CellTemplate="{StaticResource CaseIDLinkCellTemplate}" DataMemberBinding="{Binding Id}" DisplayIndex="0" IsVisible="True" />
<telerikGridView:GridViewDataColumn Header="SVOs" UniqueName="SVOs" CellTemplate="{StaticResource CaseServiceOrdersLinksCellTemplate}" DisplayIndex="1" IsVisible="True" TextWrapping="Wrap" />
<telerikGridView:GridViewDataColumn Header="Type" UniqueName="Type" DataMemberBinding="{Binding Type}" DisplayIndex="2" IsVisible="True" TextWrapping="Wrap" />
<telerikGridView:GridViewDataColumn Header="Status" UniqueName="Status" DataMemberBinding="{Binding Status}" DisplayIndex="3" IsVisible="True" />
</d:MVVMRadGridView.Columns>
发布评论
评论(1)
您可以扩展列表类并实现 IComparable 和 IEquatable 方法吗?
Can you just extend the list class and implement the IComparable and IEquatable methods?