CyanBlue
12-10-2008, 11:55 PM
How do I make the width of the first cell wider to fit into the width of the DataGrid? The width of the DataGrid is 300, but the width of the col1 cell is about 150, and I'd like that to extend to the full width of the DataGrid minus the width of the scrollBar...
What is causing this and how to solve this???
Thanks... :)
//
import fl.controls.DataGrid;
import fl.data.DataProvider;
import flash.events.Event;
var dp:DataProvider = new DataProvider();
dp.addItem({col1:"1"});
dp.addItem({col1:"2"});
dp.addItem({col1:"3"});
dp.addItem({col1:"4"});
dp.addItem({col1:"5"});
dp.addItem({col1:"6"});
dp.addItem({col1:"7"});
var dg:DataGrid;
dg = new DataGrid();
dg.setSize(300, 100);
dg.move(100, 100);
dg.rowCount = 4;
dg.columns = ["col1"];
dg.dataProvider = dp;
dg.showHeaders = true;
dg.minColumnWidth = 280;
dg.addEventListener(Event.CHANGE, gridItemSelected);
addChild(dg);
function gridItemSelected(e:Event):void
{
trace(e.target.selectedItem.col1);
}
What is causing this and how to solve this???
Thanks... :)
//
import fl.controls.DataGrid;
import fl.data.DataProvider;
import flash.events.Event;
var dp:DataProvider = new DataProvider();
dp.addItem({col1:"1"});
dp.addItem({col1:"2"});
dp.addItem({col1:"3"});
dp.addItem({col1:"4"});
dp.addItem({col1:"5"});
dp.addItem({col1:"6"});
dp.addItem({col1:"7"});
var dg:DataGrid;
dg = new DataGrid();
dg.setSize(300, 100);
dg.move(100, 100);
dg.rowCount = 4;
dg.columns = ["col1"];
dg.dataProvider = dp;
dg.showHeaders = true;
dg.minColumnWidth = 280;
dg.addEventListener(Event.CHANGE, gridItemSelected);
addChild(dg);
function gridItemSelected(e:Event):void
{
trace(e.target.selectedItem.col1);
}