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.
You will have to manually add code to grid's KeyPress event. Check if the sender is your combobox. If it is, run the code that's currently in the ValueChanged event of the combobox. I have tried this in my app and it seems to be working fine.
Hope this helps,
Rich
Agreed, but that's a hack. I want to know if Infragistics has other methods to capture events in editorcontrol.