If you make a simple gridview with 2 columns and make both columns visible, you cn use the code below to get the value. When you set visible="false" in the .aspx file, the value is no longer populated and str0 returns an empty string.
So, this did retrieve the data in beta 1 but does not now. How can I force it to retrieve the data and now show the value. I need the data for foreign key relations I am managing myself.
All-Star
15364 Points
3564 Posts
ASPInsiders
Moderator
MVP
gridview column w/visible=false no longer contains cell data in beta 2
Apr 18, 2005 06:38 PM|pkellner|LINK
If you make a simple gridview with 2 columns and make both columns visible, you cn use the code below to get the value. When you set visible="false" in the .aspx file, the value is no longer populated and str0 returns an empty string.
So, this did retrieve the data in beta 1 but does not now. How can I force it to retrieve the data and now show the value. I need the data for foreign key relations I am managing myself.
thanks, -Peter
protected
void GridView1_SelectedIndexChanged(object sender, EventArgs e)GridView
gv = (GridView)sender; int index = gv.SelectedIndex; GridViewRow gvw = gv.Rows[index]; string str0 = (string)gvw.Cells[0].Text;http://peterkellner.net
Microsoft MVP • ASPInsider