Hi,
I'm using an IList<T> of complex objects that are composed of other complex objects as properties. I can get the RadGrid to sort ok on a regular property of type string. But when I try to sort on a property that contains another business object, I get this error:
At least one object must implement IComparable.
This is what my code looks like:
<telerik:GridBoundColumn DataField="BatchNumber" HeaderText="Batch Number" SortExpression="BatchNumber" />
<telerik:GridTemplateColumn HeaderText="Client" SortExpression="Client">
<ItemTemplate><%# (((Batch)Container.DataItem).Client).Name %>
</ItemTemplate>
</telerik:GridTemplateColumn>
The blue property works fine. I can't figure out what should go in the SortExpression property to show I want the Name property from the Client object to determine my sorting.
Thanks!
Troy
I'm using an IList<T> of complex objects that are composed of other complex objects as properties. I can get the RadGrid to sort ok on a regular property of type string. But when I try to sort on a property that contains another business object, I get this error:
At least one object must implement IComparable.
This is what my code looks like:
<telerik:GridBoundColumn DataField="BatchNumber" HeaderText="Batch Number" SortExpression="BatchNumber" />
<telerik:GridTemplateColumn HeaderText="Client" SortExpression="Client">
<ItemTemplate><%# (((Batch)Container.DataItem).Client).Name %>
</ItemTemplate>
</telerik:GridTemplateColumn>
The blue property works fine. I can't figure out what should go in the SortExpression property to show I want the Name property from the Client object to determine my sorting.
Thanks!
Troy