Hi, I am facing a problem when I initialise DataGridListData class in testCombo.mxml.
I have initialised it in changeCombo method of testCombo.mxml but when i change the combo it doesnt show the value of column index in alert. If i have comment the initialisation and display somethingelse or some hardcode value, it shows the alert but doesnt show the columnIndex. Please help me to resolve this prblm. Thanks, Sanjay sharma ======== filterTest.mxml <?xml version="1.0" ?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="../*" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ import mx.events.DataGridEvent; import mx.rpc.events.HeaderEvent; import mx.collections.ArrayCollection; import mx.core.ClassFactory; import mx.controls.Alert; import mx.events.DataGridEvent; public var object2:Object = new Object(); public var object:Object = new Object(); [Bindable] [Bindable] public var authorsDataProvider : ArrayCollection = new ArrayCollection( [ { Country: "USA", Gold: 35, Status:"Active", URL:"http://www.google.com" }, { Country: "China", Gold: 32, Status:"Deactive",URL:"http://www.yahoo.com"}, { Country: "Russia", Gold: 27,Status:"Deactive", URL:"http://www.hotmail.com" }, { Country: "India", Gold: 12, Status:"Active",URL:"http://www.gmail.com"}, {Country: "Russia", Gold: 27, Status:"Deleted",URL:"http://www.hotmail.com" }, {Country: "Russia", Gold: 27, Status:"Deleted",URL:"http://www.hotmail.com" } ]); public function headerClick(evt:DataGridEvent):void{ } ]]> </mx:Script> <mx:Panel title="Header Filter" width="100%" height="100%"> <mx:DataGrid id="gridPanel" headerRelease="headerClick(event)" dataProvider="{authorsDataProvider}" width="100%" height="100%" sortableColumns="false" > <mx:columns> <mx:Array> <mx:DataGridColumn width="300" headerText="Country" dataField="Country" /> <mx:DataGridColumn width="300" headerText="Value" dataField="Gold"/> <mx:DataGridColumn width="300" headerText="Status" dataField="Status" headerRenderer="testCombo"/> <mx:DataGridColumn width="300" headerText="URL" dataField="URL"/> </mx:Array> </mx:columns> </mx:DataGrid> </mx:Panel> </mx:Application> ============= testCombo.mxml =============== <?xml version="1.0" encoding="utf-8"?> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:ComboBox id="cboAuthorsStatusFilter" dataProvider="{authorsArray}" preinitialize="init()" change="changeCombo()" > <mx:Script> <![CDATA[ import mx.controls.DataGrid; import mx.controls.Alert; import mx.collections.*; import mx.controls.dataGridClasses.DataGridListData; [Bindable] public var authorsArray:Array = ["All", "Active", "Deactive", "Deleted"]; public function init():void{ addEventListener("dataChange", handleDataChanged); } public function handleDataChanged (event:Event):void { Alert.show("s"+"handleDataChanged"); } public function changeCombo():void{ var testData:DataGridListData = DataGridListData (parentDocument.listData); Alert.show ("s"+testData.columnIndex.toString()); } ]]> </mx:Script> </mx:ComboBox> </mx:HBox>

