Hi, I have a Custom ItemRenderer, which displays a TextInput or a Label based on another column's value in the DataGrid. Here's the sample for the ItemRenderer:
MyItemRenderer.mxml <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> "> <mx:Canvas id="myRendererCan"/> <mx:Script> <![CDATA[ public var textField; private var myLabel:Label; private var myTextInput:TextInput; override public function set data(value:Object):void { myRendererCan.removeAllChildren(); if(value != null && value.colA == "M") { myLabel = new Label; myLabel.text = value[textField]; myRendererCan.addChild(myLabel); } else { myTextInput = new TextInput; myTextInput.setStyle("backgroundColor", 0xFFFF0F); myTextInput.text = value[textField]; myRendererCan.addChild(myTextInput); } } ]]> </mx:Script> </mx:HBox> In my Main.mxml , the DataGrid is as follows : <mx:DataGrid editable="true"> <mx:columns> <mx:DataGridColumn headerText="ColA" dataField="ColA" width="40" editable="false"/> <mx:DataGridColumn headerText="ColB" dataField="ColB" width="60" itemRenderer="MyItemRenderer" editable="true" rendererIsEditor="true" /> </mx:columns> </mx:DataGrid> I want to set the value which user enters in the "myTextInput" , back to the ColB of the dataProvider. I have tried a lot of examples, but none seem to work. Can anyone help me with this. I tried even by directly declaring a TextInput , rather than dynamically adding it, even then it does not work. Thanks in advance. Regards, Asgar.