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

Unable to cast error

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mtallman
Top achievements
Rank 1
mtallman asked on 05 Aug 2008, 02:04 PM
Hi,

We recently updated to the latest version of the rad controls (2008.2.723) and have encountered a new issue. I have a grid in SharePoint that is used to display some information on different SPField objects. So in my code i set the datasource of the grid to a List<SPField>. The issue seems to be that the grid tries to cast the objects in that list as the type of the first object, instead of casting it as the type the list contains. For example: I have a List<SPField> with 3 fields in it. Field 1 is of Type1, Field 2 is of Type2, Field 3 is of Type3. The error that is displayed is that it was unable to cast object of Type2 to type Type1. Why is it even casting these objects as their own type if i have it in a List<SPField>? Shouldn't it only be casting these objects as SPField?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 06 Aug 2008, 08:27 AM
Hello Matthew,

Please refer to the following forum thread:

http://www.telerik.com/community/forums/thread/b311D-bebkag.aspx

Sincerely yours,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
mtallman
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or