Retrieve primary key of the row that clicked on it (edit and delete button)
<p>I have a gridview that shows information from a <code>SqlDatasource</code>. Now the gridview shows some information with an edit button and a delete button at the end of the row.</p>

<p>I want to retrieve the primary key of that row from a table in C#, when I click on the edit or the delete button.</p>

<p>For this I overriden two functions:</p>

<pre><code>protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
   Response.Write(e.NewEditIndex);
}

protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
   Response.Write(SqlDataSource1.DeleteCommand);
}
</code></pre>

<p>But I cannot retrieve the primary key value. How can I do that?</p>
