title: GridView: Get datakey of the row on button click
body: <p>How can I get a value of the DataKeyName of a GridView Row when I have a button inside a row that have an OnClick event.  In my OnClick event of my button I want to get a the DataKeyName of the row where the button resides.</p>
  
  <p>Is this possible?</p>
  
  <pre><code>&lt;asp:GridView ID="myGridView" run="server"&gt;
       &lt;Columns&gt;
            &lt;asp:TemplateField HeaderText="Column 1"&gt;
                 &lt;ItemTemplate&gt;
                     ... bunch of html codes
                     &lt;asp:Button ID="myButton" UseSubmitBehavior="false" runat="server" Text="Click Me" onclick="btnClick_Click" /&gt;
                 &lt;/ItemTemplate&gt;
             &lt;/asp:TemplateField&gt;
       &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>In my codebehind</p>
  
  <pre><code>protected void btnClick_Click(object sender, EventArgs e)
  {
      // How can I get the DataKeyName value of the Row that the Button was clicked?
  }
  </code></pre>