The DataGridViewTextBoxEditingControl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dom

    The DataGridViewTextBoxEditingControl

    I need to capture an event from the text box that is used to edit a
    cell in the DataGridView. So I did the following:

    EditingControlS howing (sender, e)
    {
    TextBox t = (TextBox) e.Control;
    t.KeyPress += new KeyPressEventHa ndler (...)
    }

    Guess what? The KeyPress handler is triggered multiple times, and it
    gets worse every time the EditingControl is shown. I think I know
    why, and I think I need to do something like this;

    t.KeyPress = null;
    t.KeyPress += new KeyPressEventHa ndler (...)

    The problem is, I can't do the first line here. How do I get rid of
    the events that are already there?

    Dom
Working...