I have my own textbox that I would like to use as an editor control in the grid. I have code in the KeyPress event of my textbox. When I assign the EditorControl property of a given cell to the textbox, it seems to appear properly. However, my KeyPress event never fires. I assume the grid is probably blocking certain events. Is there a way to use my KeyPress event code in this situation?
Hi Richard,
No, when you assign the EditorControl property of a column or cell, the grid does not actually use the Control you assign. The editor control merely provides a copy of it's internal editor for the gid to use. So no key events actually take place on the editor control, only the grid gets key events.
I am facing the same problem. I have assigned combobox to a column of datagrid as Editorcontrol. The actual combobox is on the form with visible=false; Now i hooked up valuechanged to my combobox on the form. But, no event is fired when i change value of combobox from the column in Grid.
If this is wrong approach, pls mention the correct approach.
Thanks for the quick reply, Mike!
I have put code in the grid's KeyPress event that gets the active cell and sees if it has an editor control of the type I am looking for. I then call my KeyPress event from inside the grid's KeyPress event and everything seems to be working fine.
Rich