FindControl not finding the correct control in GridView

FireMonster

New Member
I have an issue with a GridView and a HiddenField inside the GridView. I'm trying to pull some data based in the value of the HiddenField which is basically the row_id for each record but for some reason I keep getting the same data regardless of which one I select in the GridView. The code below is the one I'm using the find the HiddenField in the GridView. Any help will be greatly appreciated it. \[code\]protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e){ foreach (GridViewRow item in GridView1.Rows) { if (item.RowType == DataControlRowType.DataRow) { rowid = (HiddenField)(item.Cells[0].FindControl("po_id_hf")); } } GridView2.DataSource = View_SP.v_asn_detail_by_asn_number(Int32.Parse(rowid.Value)); GridView2.DataBind(); step2.Visible = false; step3.Visible = true;}\[/code\]
 
Back
Top