With the gridview I need to override the delete functionality...When a user hits the delete key on a row in the grid I want to set my entity to Inactive, rather than remove it from the collection.
I tried hooking up KeyDown but it never fires for the delete key, the default functionality of removing the row happens.
I tired hooking up KeyDown with CanUserDeleteRows set to false and the key down never fires for the delete key.
I can use other keys such as backspace etc. but our users want to use delete.
The only thing that seemed to work was to handle the Deleting event and do what I want and set e.Cancel to true. The problem with this event is I can't selectivly remove from the collection ie. if my record is new/unsaved and they hit delete i want it removed but if it's a saved record that they delete i want it marked on screen as inactive. The cancel seems to be an all or nothing.
What's the best way to do the functionality that i need?
I tried hooking up KeyDown but it never fires for the delete key, the default functionality of removing the row happens.
I tired hooking up KeyDown with CanUserDeleteRows set to false and the key down never fires for the delete key.
I can use other keys such as backspace etc. but our users want to use delete.
The only thing that seemed to work was to handle the Deleting event and do what I want and set e.Cancel to true. The problem with this event is I can't selectivly remove from the collection ie. if my record is new/unsaved and they hit delete i want it removed but if it's a saved record that they delete i want it marked on screen as inactive. The cancel seems to be an all or nothing.
What's the best way to do the functionality that i need?