This is a migrated thread and some comments may be shown as answers.

Image column braking on grouping

2 Answers 98 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Inga Bemman
Top achievements
Rank 1
Inga Bemman asked on 01 Jul 2011, 05:15 AM
Hi,

I have an image column binded to an int and using converter to display an image. Everything works fine, sorting ok but it crashes app on grouping. 
Error: System.Argument.Exception : At least one object must implement IComparable. 

My Xaml below: 

<telerik:GridViewImageColumn Header="Alert" DataMemberBinding="{Binding PriorityID,Converter={StaticResource AlertImageConverter}}" ImageHeight="10" ImageWidth="10" GroupMemberPath="PriorityID" SortMemberPath="PriorityID" />

Thanks,
Inga

2 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 01 Jul 2011, 03:55 PM
Hi Inga Bemman,

I have prepared an example project that illustrates a similar scenario. Here is the key: the converter is called in order to map the integer values to their respective BitmapImage values, and then the RadGridView is properly loaded. But when we try to group it by the GridViewImageColumn, the converter is called again trying to convert the respective GroupMemberPath value to a BitmapImage value, as it is designed to do so. BitmapImage doesn't implement IComparable, so it causes an exception. Please, refer to the attached project.

Regards,
Ivan Ivanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kevin
Top achievements
Rank 1
answered on 16 May 2012, 04:32 AM
Ivan,

why is this what it was "designed to do"?  It doesn't make any sense that it should be calling the converter when it bound to a different property.  The example you gave is a hack, and only works because your GroupMemberPath property is a different type than the one you are basing the image off of.

This is a bug.

Thanks,
KB
Tags
GridView
Asked by
Inga Bemman
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or