1
I’m trying to delete line by line on DataGridView
, these lines would be in case files (attachments) without any database connection, only the following error message appears:
It is not possible to programmatically remove lines unless
DataGridView
is associated with data in aIBindingList
with support for change notification and allowing exclusion.
Follows code below:
private void DataGrid1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 4)
DataGrid1.Rows.RemoveAt(DataGrid1.CurrentRow.Index);
}
You want to remove the lines that are selected by you?
– FábioArsénio
That, I want to remove the lines I select. There are already some functions. "Open" that downloads, "Comments", and to deploy the "Delete". @Fábioarsenic
– Ronaldo Amysterdam Alves Neres
You can put the code where you "feed" this Datagrid?
– Jéf Bueno
@jbueno There are 2 btn with click event, one that attaches the file and another that saves the file in Datagrid, would be these?
– Ronaldo Amysterdam Alves Neres
The code that puts the data on the grid, whatever it is.
– Jéf Bueno
@Fábioarsenic unsuccessful attempt.
– Ronaldo Amysterdam Alves Neres
@jbueno unfortunately not. Only this information I can provide. Sorry.
– Ronaldo Amysterdam Alves Neres
No need to apologize. I will have to vote to close the question as is not clear enough, because we can’t help without more information. You can [Edit] your post at any time to try to explain your problem better.
– Jéf Bueno