In my application, I have a column in my RadGridView that is bound to a property of type 'System.Type'. When attempting to sort by this column, I get a System.ArgumentException{"At least one object must implement IComparable."}. I am not interested in wrapping the System.Type class at all to implement the IComparable(T) interface and would like to be able to provide a function delegate to the ColumnSortDescriptor to sort the types by name instead of using the default comparer as I could with a normal list.
Is there a way to do this (or something like it) currently?
Thanks,
Jason
Function
CompareTypeByName(
ByVal
x
As
System.Type,
ByVal
y
As
System.Type)
As
Integer
If
x
Is
Nothing
Then
If
y
Is
Nothing
Then
Return
0
Else
Return
-1
End
If
Else
If
y
Is
Nothing
Then
Return
1
Else
Return
x.Name.CompareTo(y.Name)
End
If
End
If
End
Function
Dim
typeList
As
New
List(Of System.Type)
typeList.Add(
GetType
(
String
))
typeList.Add(
GetType
(Int32))
typeList.Sort(
AddressOf
CompareTypeByName)
Is there a way to do this (or something like it) currently?
Thanks,
Jason