With just a regular value you would write something like
protected void GridView1_SelectedIndexChanged(Object sender, EventArgs e)
{
GridViewRow email = GridView1.SelectedRow;
txtbox.Text = email.Cells[5].Text;
}
However, I want to populate that textbox with a value that is a textbox control in the gridview. I have a list of rows and depending on which row I select that textbox will populate with that control value. Any help/advice would be greatly appreciated.
I would suggest using datakeys for this. It’s a lot easier and a lot more reliable than using the cell index:
Then, in the code-behind you can access the values like this: