title: How to set gridview to edit mode on button click instead of using commandname
body: <p>Hi all I am having a template field as follows with an itemtemplate </p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="Edit/Delete"&gt;
   &lt;ItemTemplate&gt;
       &lt;asp:LinkButton ID="lnkEdit" runat="server" Text="Edit" OnClick=lnkEdit_Click"&gt;     &lt;/asp:LinkButton&gt;
  &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>Generally instead of <code>Click</code> event we use to write <code>CommandName="Edit"</code> and on <code>OnRowEditing</code> event we will set gridview row to edit mode with the following code</p>
  
  <pre><code>protected void grdDemo_RowEditing(object sender, GridViewEditEventArgs e)
      {
          grdDemo.EditIndex = e.NewEditIndex;
          bindGrid();
      }
  </code></pre>
  
  <p>Instead of this I would to set gridview row to edit mode on link button click, how can we do that any ideas please</p>