hi guys, I have a gridview in which itemtemplate contains hiddenfield.I have a button outside gridview.In the click event of button ,i want to get the value of hiddenfield of Rows(0),means first row.Can anybody help?
+3
A:
Try:
string hiddenFieldValue = ((HiddenField) yourGridView.Rows[0].FindControl("yourHiddentFieldName")).Value;
(sorry it's not in VB.Net but I can't write in that language).
Ian Kemp
2009-08-24 12:14:27
+2
A:
In simple way
HiddenField hdf = (HiddenField)grd.Rows[0].FindControl("hidden1");
String value = hdf.Value;
Muhammad Akhtar
2009-08-24 12:15:17
+1
A:
DirectCast(GridView.Rows(0).FindControl("MyHiddenField"),HiddenField).Value
is the VB version.
PhilPursglove
2009-08-24 12:15:45