title: DataGridView with Button Control - Delete Row
body: <p>I want a Delete button at the end of each row of <code>DataGridView</code> and by clicking that I want to remove the desired row from the binding list which is data source of my grid.</p>
  
  <p>But I can't seem to do it I have created a button object in product class and instantiated it with the unique id to remove that object from list. but button is not showing in the row.</p>
  
  <p><a href="https://i.stack.imgur.com/wvVVW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wvVVW.png" alt="Screen shot"></a></p>
  
  <p>There are TextBoxes in the form and users can enter text, and when they press Add button, a new object of product is instantiated with the provided fields and then it is added to the <code>BindingList</code>.</p>
  
  <p>Finally this list is bound to the <code>DataGridView</code> and details are shown in the grid. (I have done this part).</p>
  
  <p>and at last by clicking save button the list is saved in the DB.</p>
  
  <pre><code>public class Product{
      public string Brand { get; set; }   
      public int ProductPrice { get; set; }
      public int Quantity { get; set; }
  
      public product(string brand,int productPrice, int quantity){   
          this.Brand = brand;
          this.ProductPrice = productPrice;
          this.Quantity = quantity;
      }   
  }
  
  public partial class MainForm: Form{
      .....
      BindingList&lt;Product&gt; lProd = new BindingList&lt;Product&gt;();
      private void btnAddProduct_Click(object sender, EventArgs e){
          string Brand = txtProBrand.Text;
          int Price = Convert.ToInt32(txtPrice.Text);
          int Quantity = Convert.ToInt32(txtQuantity.Text);
  
          Product pro = new Product(Brand, Price, Quantity);
          lProd.Add(pro);
          dataGridView1.DataSource = null;
          dataGridView1.DataSource = lProd;
      }
      .....
  }
  </code></pre>