views:

579

answers:

1

I have a DataGrid with an drop-in Button itemRenderer:

<mx:DataGridColumn headerText="" width="135" 
    itemRenderer="ActionButtonItemRenderer" />

However, the button extends all the way both the right and left edge of the DataGridColumn. I've tried messing with the width properties and paddingLeft and paddingRight styles of both the DataGridColumn and the itemRenderer, but nothing seems to work.

NOTE: I do not want to use a Container or UIComponent with the Button as a child as the itemRenderer - too much code.

Is there a simple way to add left and right padding?

A: 

The button should only be as wide as you specified when you created it as a component, unless you created the component with 100% as the width. So, try a different percent width, a fixed pixel value, or (as you said you don't want to do) using a canvas based item renderer component with a button positioned inside of it.

As I stated in the original question, setting an explicit width on either - or both - the itemRenderer Class and the DataGrid Column has no effect on the size of the Button. It simply fills the column width.
Eric Belair