Or TextBox1.Text = row.Cells[Index].ToString();
>Hi,
>
>I'm a bit of newbie to .Net myself so feel free to ignore anything I say but can you get the row by something like this:
>
>GridViewRow row = GridView1.SelectedRow;
>TextBox1.Text = row.["id"].ToString();
>
>Again apoplogies if i'm miles off the mark.
>
>Jon
>
>>Hi all,
>>
>>How can I refer to DataRowView in GridView1.SelectedIndexChanged Event, I try code below, but system NullReferenceException error.
>>
>>
>>
>>
>>
>> protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
>> {
>> DataRowView drv = (DataRowView) GridView1.SelectedRow.DataItem;
>> TextBox1.Text = drv["id"].ToString();
>>
>> }
>>
>>
>>
>>TIA.