Hi,
If you don't have to use DataBinder.Eval then don't because it involves
reflection. Anyways, what you look for is probably something like
Dim myField As String = DataBinder.Eval(e.Item.DataItem,"MyField")
Container in a databinding expression refers to the DataGridItem. so
therefor replacing Container.DataItem with e.Item.DataItem (e being the e in
event arguments for ItemDataBound)
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Niclas" <NO****@Notmail.com> wrote in message
news:eV***************@tk2msftngp13.phx.gbl...
Hi,
I would like to evaluate a field in a datagrids data source (that is not
bound to a column in the grid) in code behind rather that using inline
code Databinder.Eval(container.dataItem,"MyField"). I don't seem to be
able to use "container" in code behind, Would appreciate if someone
could explain how this statement would look within the ItemdataBound
event.
Thanks
Niclas
*** Sent via Developersdex http://www.developersdex.com ***