July 2009
11 posts
Play
How to store the value of a cell in a variable
Looked in a million places, tried a million things, nothing worked.
Eventually this is what I came up with.
Create your gridview and populate it. After:
Page.DataBind()
Create a GridViewRow with the row that you want to get the data from
Dim nameOfYourRow As GridViewRow = nameOfYourGridView.Rows(1)
Put the content of the cell (in this case cell 5) in the variable
nameOfYourVariable = nameOfYourRow.Cells(5).Text
There you go!