dipke p

dipke p

  • NA
  • 1
  • 1.1k

Datagridview remove rows

Jan 30 2014 9:05 AM

I have a datagridview that is filled with data from a DB.
When i delete a row by pressing the delete button, the row is deleted.
But when i loop through the rows that are in the datagridview, the deleted rows keep showing up in the collection of teh datagrid.

I want to first delete some rows from the datagridview and do an update from the DB after a check if the deleted rows can be deleted.
When i add some rows, there is no problem. the added rows are in the collection of the dataGrid.

1) when i have 4 rows and delete 2 rows the rowcount remains 4.
2) When i have 4 rows and add 2 rows the rowcount coms to 6.

Kind regards

Answers (2)