AMLabels
asked on
Deleting DataGridViewRow with Underlying DataRelation
Hi,
I have a DataGridView which is populated from a DataTable that has a foreign key constraint linking it to another DataTable.
When I delete a row in the DataGridView that the second DataTable depends on, the DataError event is fired because the deletion will cause orphan rows in the second DataTable.
Is there any way to delete/remove a row from the DataGridView (rendering it not visible to the user) without deleting it in the underlying DataTable?
This would be useful becuase I never want to physically delete records, but rather to set a boolean flag indicating it as deleted.
Thanks.
I have a DataGridView which is populated from a DataTable that has a foreign key constraint linking it to another DataTable.
When I delete a row in the DataGridView that the second DataTable depends on, the DataError event is fired because the deletion will cause orphan rows in the second DataTable.
Is there any way to delete/remove a row from the DataGridView (rendering it not visible to the user) without deleting it in the underlying DataTable?
This would be useful becuase I never want to physically delete records, but rather to set a boolean flag indicating it as deleted.
Thanks.
ASKER
I tried setting the row visible to false, but the application throws an error stating that the operation was not allowed in the current context.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not a good enough answer? Did you manage to do something else? What was your final solution?
Bob
Bob
Bob