i want to display datagrid selected index in text input in as3 code. I don't
know how to binding .Can anybdy send me a code....I am posting my as code
and mxml file here

DragDropDataGrid.as
package
mycomp
{
import mx.controls.DataGrid;
import mx.controls.TextInput;
import mx.core.UIComponent;
public class DragDropDataGrid extends UIComponent
{



public function DragDropDataGrid()
{
super();
}
public var dg:DataGrid;
public var dg1:DataGrid;
public var txt:TextInput;
[
Bindable]
public var mouseX1:int;
override protected function createChildren():void{
super.createChildren();
if(!dg){
dg =
new DataGrid();
dg1 =
new DataGrid();
var aRoster:Array = new Array();
aRoster = [
{Name:
"Wilma Carter", Bats:"R", Throws:"R", Year:"So", Home: "Redlands, CA"},
{Name:
"Sue Pennypacker", Bats:"L", Throws:"R", Year:"Fr", Home: "Athens, GA"},
{Name:
"Jill Smithfield", Bats:"R", Throws:"L", Year:"Sr", Home: "Spokane, WA"},
{Name:
"Shirley Goth", Bats:"R", Throws:"R", Year:"Sr", Home: "Carson, NV"},
{Name:
"Jennifer Dunbar", Bats:"R", Throws:"R", Year:"Fr", Home: "Seaside, CA"},
];
dg.dataProvider=aRoster;
dg.allowDragSelection=
true;
dg.allowMultipleSelection=
true;
mouseX1=dg.contentMouseX;
dg1.dataProvider=aRoster;
dg.columnWidth=500;
//dg.columns = ["Name", "Bats", "Throws", "Year", "Home"]; /*
dg.columns[0].width = 500;
dg.columns[1].width = 500;
dg.columns[2].width = 500;
dg.columns[3].width = 400;
dg.columns[4].width = 500; */
dg.editable=
false;
dg.liveScrolling=
true;
dg.dragEnabled=
true;
dg.selectedIndex=1;
dg1.dropEnabled=
true;
dg.editable=
false;
addChild(dg1);
addChild(dg);
}
if(!txt){
txt =
new TextInput();
txt.explicitWidth = 80;
txt.editable =
true;
txt.text=
"Vijay";
addChild(txt);
}
}
override protected function commitProperties():void{
super.commitProperties();
invalidateDisplayList();
}
override protected function measure():void{
super.measure();
}
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):
void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
dg.setActualSize(350,350);
dg1.setActualSize(350,350);
txt.move(400,400);
txt.setActualSize(100,50);
dg1.move(400,0);
dg.move(0,0);
}
}
}
mxml file
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
xmlns:DnG="mycomp.*">
<DnG:DragDropDataGrid/>
</mx:Application>

-- 
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.

Reply via email to