A renderer is always as wide as its column. You can wrap it in another layer if you want to center it.
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markflex2007 Sent: Thursday, April 24, 2008 11:05 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Button in DatGrid problem Hi, I add a buttin in datagrid.But why the button always fill the all column width. I try to set it 20 but the column width is 100. it always like 100 in the layout. why? Thanks Mark <mx:DataGrid id="dg1" dataProvider ="{dp}"> <mx:columns> <mx:DataGridColumn width="100" headerText="" > <mx:itemRenderer> <mx:Component> <mx:Button label="Select it" width="20" /> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> <mx:DataGridColumn headerText="names" dataField="names" width="200" /> <mx:DataGridColumn headerText="sex" dataField="sex" width="300" /> </mx:columns> </mx:DataGrid>