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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top