J
Jeff
Hi all,
I have a page that populates a gridview, the gridview has a select button
column enabled. When the users pushes the button to select a column
on the Gridview1_SelectedIndexChanged event I have
GridviewRow selectedRow = Gridview1.SelectedRow;
Session["SelectedEvent"] = selectedRow;
I do a page redirect and on the new page I want to fill a text box with one
of the cells in the GridviewRow.
So on the new pages onload event I have
GridviewRow selectedEventRow = (GridviewRow)Session["SelectedEvent"] ;
Now if I put:
txtBox1.Text = selectedEventRow.cells[4].Text;
the textbox populates fine with the info from cell index 4
What I would like to do is instead of using the cell index number I want to
reference it by the column name
something like
txtBox1.Text = selectedEventRow.cells["FirstNmae"].Text;
but this produces an error saying that it requires an [int] ?
How can I reference by name instead of index number?
Thanks,
Jeff
I have a page that populates a gridview, the gridview has a select button
column enabled. When the users pushes the button to select a column
on the Gridview1_SelectedIndexChanged event I have
GridviewRow selectedRow = Gridview1.SelectedRow;
Session["SelectedEvent"] = selectedRow;
I do a page redirect and on the new page I want to fill a text box with one
of the cells in the GridviewRow.
So on the new pages onload event I have
GridviewRow selectedEventRow = (GridviewRow)Session["SelectedEvent"] ;
Now if I put:
txtBox1.Text = selectedEventRow.cells[4].Text;
the textbox populates fine with the info from cell index 4
What I would like to do is instead of using the cell index number I want to
reference it by the column name
something like
txtBox1.Text = selectedEventRow.cells["FirstNmae"].Text;
but this produces an error saying that it requires an [int] ?
How can I reference by name instead of index number?
Thanks,
Jeff