NeCroFire

NeCroFire

  • NA
  • 86
  • 0

Adding a Delete button to datagrid with code

Jul 24 2008 8:33 AM
I am using the example in the link to have a user add items to a datagrid.
http://geekswithblogs.net/dotNETvinz/archive/2008/05/07/adding-multiple-columns-and-rows-in-gridview-without-using-a-again.aspx

I want the user to be able to remove an item if need be.
I've searched a lot, but can't seem to fined exactly what I'm looking for.

They use this to add a column:
dt.Columns.Add(new System.Data.DataColumn("TextBox3Column", typeof(String)));

and this to add a cell:
dr[0] = TextBox1.Text;

How can I add a ButtonColumn this way so there would be a 'Remove' button at the end of every row that was added by the user.

Thanks

Answers (3)