I am creating GridView
by creating DataTable
and setting it as a Datasource
of GridView
, similar to
add new row in gridview after binding C#, ASP.net
After calling DataBind()
I cannot access values of the cells as Text
attribute is empty for every cell, however everything is displayed on the page.
I have already tried:
How to get cell value from a gridview?
but Text
attribute is also empty, and
How to get cell value in GridView (WITHOUT using cell index)
throws exception as DataItem
is null. Any ideas what am I missing?