views:

697

answers:

1

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.

A: 

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?

womp