I have a formview and a nested gridview where i would like to be able to select the value of a specific cell when the row has been updated. I took the example code from the msdn site as it's close to what i want:
protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{
GridView SprayGrid = (GridView)FormView1.FindControl("GridView1");
int Index = SprayGrid.EditIndex;
GridViewRow row = SprayGrid.Rows[Index];
TextBox message = (TextBox)FormView1.FindControl("TextBox1");
message.Text = row.Cells[4].Text;
}
However, for some reason this will only pick up the index of the cell, i.e. if i change the row.cells[0] i can see in my message box the index number if i want to see any other cell then the message is blank? Any ideas would be great.