I have a DataGridView bound to a object data source. The object has a property "IsDeleted". When the user presses the delete key, or clicks the delete button, or deletes a row in some other way, i want to set the "IsDeleted" flag instead of removing the row. (I then want the datagridview to update).
What is the single point of contact i need to achieve this behaviour?
I don't want to try to handle all the user paths seperately.
You can handle the event
UserDeletingRow
toCancel
it manually and perform your owndeletion
like this:You just said that your object has a property called
IsDeleted
, so I suppose it's calledYourObject
, you have to cast theDataBoundItem
to that type so that you can access theIsDeleted
property and set it totrue
. That's all.