Hi, once go throuth this sample code which might help you.where in this code i maintained a flag in data and when user clicks the checkbox i am updating the data to true,on delete button click i am iterating the collection write your logic to delete records
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" verticalAlign="middle"> <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.collections.ArrayCollection; [Bindable] public var resultArray:ArrayCollection = new ArrayCollection( [{firstName:'santosh',lastName:'Kumar',city:'HYD',empCode:'1',status:false}, {firstName:'santosh',lastName:'Kumar',city:'HYD',empCode:'2',status:false}, {firstName:'santosh',lastName:'Kumar',city:'HYD',empCode:'3',status:false}, {firstName:'santosh',lastName:'Kumar',city:'HYD',empCode:'4',status:false}, {firstName:'santosh',lastName:'Kumar',city:'HYD',empCode:'5',status:false}]); public function onDelete():void { for(var cnt:int=0;cnt<resultArray.length;cnt++) { if(resultArray.getItemAt(cnt).status) { Alert.show(resultArray.getItemAt(cnt).empCode.toString()); } } } ]]> </mx:Script> <mx:DataGrid id="dgEmployeeInfo" dataProvider="{resultArray}" x="131" y="95" editable="false"> <mx:columns> <mx:DataGridColumn headerText="Select" rendererIsEditor="true" editorDataField="selected"> <mx:itemRenderer> <mx:Component> <mx:HBox> <mx:CheckBox id="testChk" change="{data.status=!data.status}" selected="{data.status}"> </mx:CheckBox> </mx:HBox> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> <mx:DataGridColumn headerText="First Name" dataField="firstName"/> <mx:DataGridColumn headerText="Last Name" dataField="lastName"/> <mx:DataGridColumn headerText="City" dataField="city"/> <mx:DataGridColumn headerText="Employee Code" dataField="empCode"/> </mx:columns> </mx:DataGrid> <mx:Button label="Delete" click="onDelete()"/> </mx:Application> Thanks & Regards Santosh Kumar Molugu http://techflex.blog.com -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

