Stumped on trying to get gridview cell contents
Posted on 2011-10-20
Boy am I stumped on this one.
I am dynamically populating a GridView like this:
Where mdt is a DataTable and dr is a datarow -
dr = mdt.NewRow()
'fill in the dr cols
gvMoveDetails.DataSource = mdt
This works fine for the columns that contain characters, but does not seem to work for numerics.
Example (col definitions between dr and gvMoveDetails are the same):
I can see that dr(11) has "2" in it before the databind is executed.
After the databind is executed, that same column in the gridview has spaces instead of a "2":
gvMoveDetails.Rows(0).Cells(11).Text = ""
fyi...The value is in the cell itself and not within a control that lives in the cell.
Another key point....The cells I am trying to extract from the gridview has visible=false.
Any ideas what I might be doing wrong?