![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
I'm trying everything to get my DataGrid to display how I want it - with an
explicit width - but it's not cooperating. It seems to set it's own width. The only workaround I've found is to add a Container above the DataGrid with a Label inside of it (????): <mx:Box width="100%"> <mx:Label text="" /> </mx:Box> Why this works, I have no idea.... Please help... private function dataGrid_creationCompleteHandler():void { Alert.show(styleColumn.width.toString()); // "107.2" styleColumn.width = 400; dataGrid.validateNow(); Alert.show(styleColumn.width.toString()); // "107.2" } <mx ataGrid id="dataGrid" width="100%" height="100%"dataProvider="{myAC}" editable="true" verticalScrollPolicy="on" verticalAlign="middle" allowMultipleSelection="true" draggableColumns="false" sortableColumns="false" resizableColumns="false" showDataTips="true" dataTipFunction="dataGrid_dataTipFunction" creationComplete="dataGrid_creationCompleteHandler ();"> <mx:columns> <mx ataGridColumn id="nameColumn" headerText="Name"dataField="name" editable="false" /> <mx ataGridColumn id="styleColumn"dataField="customStyle" labelFunction="styleLabel" headerText="Style" editable="true" itemEditor="CustomStyleItemEditor" editorDataField="customStyle" editorXOffset="5" editorWidthOffset="-5" /> </mx:columns> </mx ataGrid> |
| Sponsored Links |
|
|||
|
Eric,
Change your creationComplete="dataGrid_creationCompleteHandler (); to initialize="dataGrid_creationCompleteHandler(); or whatever you want to call the method. At the point of creationComplete your datagrid has already drawn itself. During the initialize the properties are set for each column to use before it draws itself. I have never manipulated grid columns widths programatically after it has drawn itself so I am not sure how to do this. (I would think it would be possible). You could also define the width within each datagridcolumn. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise