views:

254

answers:

1

I have just come across a Casting Exception while using the Telerik RadGrid.

It occurs during the DataBind event if I have an array of objects as the datasource

radgrid1.DataSource = new BaseObject[] { new ChildObject1(), new ChildObject2() };

where the classes ChildObject1 and ChildObject2 both inherit from the class BaseObject.

A: 

Just found the answer.

var objects = new BaseObject[] { new ChildObject1(), new ChildObject2() }; radgrid1.DataSource = new List<BaseObject>(objects);

zonkflut