A bit ashamed to ask this but, what is equivalent of Container.DataItem from DataGrid in GridView. I don't want to use Eval and I don't want to bind it to DataSource control. I want to be able to do this <%#((MyType)Container.DataItem).MyAttribute %> in template field.
SOLVED: Nevermind, it actually works, my tag was not closed in the aspx page correctly.
You can use Container.DataItem with a GridView - what you've got there looks fine. What error are you getting?
This link might also help: What's the deal with DataBinder.Eval and Container.DataItem?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With