The DataGrid will not let you partially fill it with columns so it will stretch all or just the last column to completely cover its width.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Rick Root Sent: Thursday, April 19, 2007 7:35 AM To: [email protected] Subject: [flexcoders] Problem resizing datagrid columns I'm trying to specify the width of some datagrid columns.... and failing! The MXML code will follow my message.... the specific problem I'm having is with two simple columns that just contain text data... I'm trying to specify a width of 30 and they columns just won't shrink down to that size. they look fine in design view but render as if the minWidth was set to 70 (for the Status column) and 80 (for the type column). <mx:DataGrid variableRowHeight="true" id="dgResults" doubleClickEnabled="true" doubleClick="mx.core.Application.application.launchDetailsWindow(dgResul ts.selectedItem.ENTITYID);" width="100%" height="100%" click="Alert.show(dgc1.width.toString(), 'width', Alert.OK);"> <mx:columns> <mx:DataGridColumn headerText="" width="30" dataField="ENTITYID"> <mx:itemRenderer> <mx:Component> <mx:Canvas width="30"> <mx:Image source="/include/info-icon.gif"/> </mx:Canvas> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> <mx:DataGridColumn headerText="Entity ID" width="80" dataField="ENTITYID"> <mx:itemRenderer> <mx:Component> <mx:Label text="{data.ENTITYID}" selectable="true"/> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> <mx:DataGridColumn headerText="Status" minWidth="30" width="30" dataField="RECORD_STATUS" dataTipField="RECORD_STATUS_DESC"/> <mx:DataGridColumn headerText="Type" minWidth="30" width="30" dataField="RECORD_TYPE" dataTipField="RECORD_TYPE_DESC" id="dgc1"/> <mx:DataGridColumn headerText="Entity Details" dataField="PRSRTNAM"> <mx:itemRenderer> <mx:Component> <mx:Text htmlText="{data.DETAILS}"/> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> <mx:DataGridColumn headerText="Preferred Address" dataField="PRSRTNAM" sortable="false"> <mx:itemRenderer> <mx:Component> <mx:Text htmlText="{data.ADDRESSINFO}"/> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> </mx:columns> </mx:DataGrid>

