How to run some checkings first when trying to delete a row in a datagrid?

  • Thread starter Thread starter ywchan
  • Start date Start date
Y

ywchan

I want to check before a row in datagrid is deleted by pressing 'Delete'
button in the UI...
If the criteria is not meet, then the 'delete' button effect will be
cancelled, please advise how to do this...Thanks a lot!!
 
Hi,

First of all, you'll need to create a derived control based on the DataGrid.
Next, override the following methods:

ProcessCmdKey to intercept Alt-Del (works as Del in the grid so watch out
for this keystroke as well).
PreProcessMessage to intercept Del keystroke.
 
Back
Top