title: removing a row from gridview dynamically at runtime
body: <p>I have created a gridview which adds a remove button through item template. I wish to know how do u remove the row from grid view dynamically depending upon the button he clicks ?</p>
  
  <pre><code>protected void RemoveBtn_OnClick(object sender, EventArgs e)
      {
          Button clickedButton = sender as Button;
          GridViewRow row = (GridViewRow)clickedButton.Parent.Parent;
          int rowID = Convert.ToInt16(row.RowIndex);
  
          GridView1.DeleteRow(rowID);
      }
  
  
  
  &lt;asp:GridView ID= "GridView1" runat="server" AutoGenerateColumns="true" OnRowDeleting="RowDeletingEvent"&gt;
  &lt;Columns&gt;
      &lt;asp:TemplateField HeaderText="Remove Items"&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:Button id="RemoveBtn"  runat="server" Text="Remove" OnClick="RemoveBtn_OnClick"/&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
  &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Thank you in anticipation</p>