I'm trying to access a DataItem object during the ItemDataBound event in the 3.5 ListView control. I need to access the child object's properties. I'm using LINQ to retrieve the data.
Going by example, I'm unable to use the code the MS specifies here:
http://msdn.microsoft.com/en-us/library ... bound.aspx
The System.Data.DataRowView is not a valid cast, and I can't even get to the object doing something like this:
DataBinder.Eval(((System.Web.UI.WebControls.ListViewDataItem)e.Item), "Orderid")
OR this:
((System.Web.UI.WebControls.ListViewDataItem)e.Item).DataItem["Orderid"]
Please advise ASAP.