DataGridView, text cell edit mode and Delete key

  • Thread starter Richard Lewis Haggard
  • Start date
R

Richard Lewis Haggard

Environment: VS05 in a C# application.

I have an unbound DataGridView that has a number of custom columns in
addition to the default Text cell columns. In both the default standard text
cells and my custom RichText cells, when a single cell is executing an
inplace edit and some characters in the cell are selected, actuating the
Delete key does nothing. I want it to delete the selected characters.
Backspace and Control X both work so it is unclear why Delete wouldn't. What
else do I need to do to enable Delete key operations?
 
R

Richard Lewis Haggard

I never did figure out why Delete wasn't being passed directly to the cell
but I have a work around. In the application, the top level menu has an
Edit->Delete command and its accelerator is the Delete key. When the
Edit->Delete clicked event handler is called, this gets passed down to the
form that contains the DataGridView. It looks to see if a single cell is
selected and in edit mode. If so, the cell's selected text is replaced with
a NULL string.
 

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

Top