1
votes

I have a itemrenderer in datagrid and I am trying to get the instance of itemrender in datagrid keypressevent as follows

var col:DataGridColumn = _datagrid.columns[_datagrid.selectedCells[0].columnIndex];
var myItemrend:MyItemrender = col.itemRenderer as MyItemrender;

But the above myItemrend instance is null. How can I get the itemrenderer instance.

Please help.

Thanks, Rejeev.

1
why do you need such hack? it looks few weird. Better to access current selected cell, and it will be also an instance of MyItemRenderer, but better explain why do you need it for. - Eugene

1 Answers

0
votes

I have an itemrenderer in Datagrid and it is used as itemeditor also by rendererIsEditor=true. My itemrenderer has a textinput and a list, where I open the list, for editing, when a focusin event is occurred in textinput, this happens while clicking the cell.

I need the same editing to happen while I enter using the keyboard(Enter), so I am trying to get the instance of the itemrender in Keyboard.ENTER and using this I can dispatch the textinput focusin event.

Thanks, Rejeev.