When I try to databind an ASP.NET GridView
to an IEnumerable
using an ObjectDataSource
, I get the following excep
The opensource framework Impromptu-Interface can do this. It has a method for exposing dynamic object properties for reflection by passing in a dictionary of property names->types.
IEnumerable tProxiedObject = listOfExpandos.Select(x=>Impromptu.ActLikeProperties(x, x.ToDictionary(k=>k.Key,v=>typeof(object))));