How to get the values of a cell from a datagridview by using hyperlinks? in c# using asp.net
<p>I am new to asp.net.
I need to use a datagridview with hyperlinks for the frist column.
when clicked on any of the cell in that first column, details of the entire row should be available in the textboxes.</p>

<p>Thanks in advance :)</p>

<p>The Html code for the gridview is</p>

<p>

<pre><code>        onselectedindexchanged="DataGV1_SelectedIndexChanged"&gt;
        &lt;Columns&gt;
            &lt;asp:HyperLinkField DataTextField="first_name" HeaderText="first_name" 
                InsertVisible="False" NavigateUrl="~/Default.aspx" 
                SortExpression="first_name"  /&gt;
            &lt;asp:BoundField DataField="role" HeaderText="role" 
                SortExpression="role" /&gt;
        &lt;/Columns&gt;
    &lt;/asp:GridView&gt;
</code></pre>

<p>the code behind</p>

<pre><code>    protected void Page_Load(object sender, EventArgs e)
    {


        for (int i = 0; i &lt; DataGV1.Rows.Count; i++)
        {
            if (DataGV1.SelectedIndex == i)
            {
                String name = DataGV1.Rows[i].Cells[1].Text; 
                txtName.Text = name;
            }
        }

     }
    protected void DataGV1_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataGrid d = new DataGrid();
       //this would work if AutoGenerateSelectButton is true.
       txtName.Text=DataGV1.SelectedRow.Cells[0].Controls[0].ToString();
       //txtName.Text = DataGV1.SelectedRow.Cells[0].Text;


    }
</code></pre>

<p>I'm not able to figure out as to what to when a hyperlink is used.</p>
