2
Populo the datagridView
thus:
dgvProdutosErp.DataSource = produtos; // produtos é uma lista
I try to remove as follows:
foreach (DataGridViewRow row in dgvProdutosErp.Rows)
{
dgvProdutosErp.Rows.RemoveAt(row.Index);
}
The following error occurs:
It is not possible to programmatically remove lines unless Datagridview is associated with data in an Ibindinglist with change notification support and that allows deletion.
You cannot remove the item from
datagridview
, because it is associated withdataSource
, you must delete the line in products and update thedgvProdutosErp
, or not using theDataSource
and fill in thedatagridview
on the same hand– Marco Giovanni
Thank you Marco...
– novato