D
david
I've bound my GridView to a LinqDataSource control, but now I want to do
some work in the RowDataBound event.
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
var item = e.Row.DataItem;
But now what do I do. When using ObjectDataSource and DataSets, I could
cast that item to a DataRowView and access the properties from there.
But here it seems I have an anonymous type.
As far as I can see, my only options are Reflection or DataBinder.Eval
with this object. Is there any way to coerce the LinqDataSource into
giving me a non-anonymous type?
Or is there a better workaround to this?
TIA
David
some work in the RowDataBound event.
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
var item = e.Row.DataItem;
But now what do I do. When using ObjectDataSource and DataSets, I could
cast that item to a DataRowView and access the properties from there.
But here it seems I have an anonymous type.
As far as I can see, my only options are Reflection or DataBinder.Eval
with this object. Is there any way to coerce the LinqDataSource into
giving me a non-anonymous type?
Or is there a better workaround to this?
TIA
David