PDA

View Full Version : cell width/height problem with datagrid


Flippie124
02-02-2005, 04:32 PM
how can I set my cellwidth on a custom buttoncellrenderer?
I tried many things but my buttons are always screwed up :(...

I've set my columnwidth like this:

col.width = 50; (col is a DataGridColumn instance)

then I set the following values in my custom cellrenderer class:

function size():Void{
btn._width = 50;
btn._height = 20;
}

function getPreferredHeight(Void) : Number{
return 50;

}

function getPreferredWidth(Void) : Number{
return 20;
}

The result:
my buttons appear to be stretched (like 10x) but when I resize the column by dragging the borders my button get's the normal sizes(50/20)... I don't understand that getPreferredWidth/height thing