Tuesday, May 27, 2008

Dynamic (Advanced)DataGrid columns

Trying to add columns dynamically to your DataGrid or AdvancedDataGrid and having trouble with specifically setting the width of a column?

Try the following:

var cols: Array = datagrid.columns;
cols.push(newColumn);
datagrid.columns = cols;
// The following line is very important
// (otherwise the grid won't be aware of the new columns yet)
datagrid.validateNow();
// Force the width of a specific column
cols[0].width = 40;

Thursday, May 15, 2008

Reducing the space between the legend marker and the legend label

If you ever try to reduce the space between the legend markers and the legend labels:

LegendItem
{
horizontalGap: 0;
verticalGap: 0;
}