<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.ListEvent;
import mx.controls.Alert;
public var n:String;
public var e:String;
public var m:String;
[Bindable]
public var arr:Array;
public function clicks(event:ListEvent):void
{
n = String(dg1.selectedItem.name);
e = String(dg1.selectedItem.emailid);
m = String(dg1.selectedItem.mobile);
}
public function adds():void
{
arr = [{label:n,data:1},{label:m,data:2}];
}
]]>
</mx:Script>
<mx:XMLList id="lists" xmlns="">
<employee>
<name> NatarajanV</name>
<emailid> [EMAIL PROTECTED]</emailid>
<mobile>9940907516</mobile>
</employee>
<employee>
<name> Vijay Kumar</name>
<emailid> [EMAIL PROTECTED]</emailid>
<mobile>9994266515</mobile>
</employee>
<employee>
<name> Vissanth </name>
<emailid>[EMAIL PROTECTED]</emailid>
<mobile>9842042711</mobile>
</employee>
</mx:XMLList>
<mx:Panel x="41.5" y="35" width="848" height="384" layout="absolute">
<mx:Button x="409" y="119" label="Add" click="adds()"/>
<mx:DataGrid x="10" y="62" id="dg1" dataProvider="{lists}"
columnWidth="30" itemClick="clicks(event)">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name"/>
<mx:DataGridColumn headerText="E-MailID" dataField="emailid"/>
<mx:DataGridColumn headerText="Mobile" dataField="mobile"/>
</mx:columns>
</mx:DataGrid>
<mx:DataGrid x="544" y="62" id="dg2" dataProvider="{arr}" >
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name"/>
<mx:DataGridColumn headerText="Mobile" dataField="mobile"/>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Application>
Hi
if i select particular row from data grid then if i click add means the
particular row comes to second data grid
i have some problem in by clicking adding button
PLZ HELP ME
regards
NatarajanV
Unlimited freedom, unlimited storage. Get it now, on
http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/