0 Replies Latest reply on Aug 24, 2007 7:46 AM by aranud

    DataGrid columns width messed up by TabNavigator

    aranud
      Dear all,

      I am creating in ActionScript a TabNavigator containing 2 identical DataGrids...But for some obscure resizing reasons, the second DataGrid display invalid column sizes... (my debugger tells me that the explicitWidth attributes of the second DataGrid columns are reset to NaN)

      This problem can be easily reproduced in MXML by setting the creationPolicy attribute of the TabNavigator and the inner Canvas to "true". In the example below, the problem is visible when switching between the tabs.

      Does anyone knows how to work around this problem?

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:TabNavigator width="400" height="200" creationPolicy="all">
      <mx:Canvas label="Tab 1" width="100%" height="100%" creationPolicy="all">
      <mx:DataGrid width="100%" x="0" height="100%">
      <mx:columns>
      <mx:DataGridColumn headerText="Column 1" dataField="col1" width="100" />
      <mx:DataGridColumn headerText="Column 2" dataField="col2" width="100" />
      <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Canvas>
      <mx:Canvas label="Tab2" width="100%" height="100%" creationPolicy="all">
      <mx:DataGrid width="100%" height="100%">
      <mx:columns>
      <mx:DataGridColumn headerText="Column 1" dataField="col1" width="100" />
      <mx:DataGridColumn headerText="Column 2" dataField="col2" width="100" />
      <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Canvas>
      </mx:TabNavigator>
      </mx:Application>