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.
talal_tk said: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.
Yes, this is the wrong approach. As I explained above, the grid does not use the CONTROL that is on the form. The editor control simply provides an editor for the grid to use. Trapping the ValueChanged of the Combo would not be any good to you even if it fired, because this event could not tell you which cell was being edited or if you were editing a cell in the grid or the ComboBox itself.
To trap for chanes in a grid cell, you need to trap a grid event like CellChanged or BeforeCellListCloseup or Before/AftercellUpdate in the grid.
Also, unless you are using a DataFilter or you need to add EditorButtons in the grid cell, using an UltraComboEditor control to provide a dropdown in a cell is really not the best way to do it. It's rather inefficient. You would be better off using a ValueList or an UltraDropDown control.
HOWTO:What is the best way to place a DropDown list in a grid cell?
thanks.Will try this link.
This is discussed in detail in several other posts in these forums. Here's a good one:
About ComboBox : FileDirectory view combo - Infragistics Community
I have my own user control .I want to display that user control on drop down of the cell.Say
,instead of the datetime picker,i want my calendar control to be displayed.
How can i do that.
Please help me with some code snippets.