Flex DataGrid columns won't resize
===

I am having serious problems trying to resize columns in a DataGrid.  I've been at it for over a day now and am at my wit's end with a headache to boot.

Essentially, I have a TabNavigator component with NavigatorContent children inside.  In each one of the NavigatorContent children, I have a DataGrid to which I'm setting the width to 100% (this is needed to be able to handle resizing of the browser window).  I am using the excellent [filterable DataGrid from Iwo Banas][1] as the DataGrid in each tab.

Now, I am making visible/invisible some columns in each of the DataGrids and this is working fine.  However, I find that the column widths are not being set correctly.  Whenever I set the column widths (using [this][2] code), all of the columns seem to be set to the correct width except for the ones that I have recently made visible and the column immediately to the left of these.  The ones recently made visible are very small (though I set their width to 30) and the one to the left of these columns is very large (though I've also set its width to 30).

I think it's something to do with the life cycle of the DataGrids because the first DataGrid behaves fine.  It's when I click on the other tabs that I find that the widths of the other DataGrids have not been set correctly.

However, if I "see" one of those problem DataGrids (i.e. it appears on the screen) and the code which resizes the columns runs again, the columns are correctly sized.

I have tried a number of things recommended all over the internet including the questions listed below but to no avail.

This is the code I'm using to resize the columns (taken for [this][3] answer)

    public static function resizeColumn(col:DataGridColumn, size:int):void
            {
                    var owner:* = col.mx_internal::owner
                    col.mx_internal::owner = null;
    
                    col.width = size;
    
                    col.mx_internal::owner = owner;
            }

Any and all help would be greatly appreciated.
[Flex DataGrid column width: one column to rule them all?][4]
[Flex 3 DataGrid Column Width Problem][5]
[Flex DataGrid Column Width][6] (<-- this answer got me closest)
[Unable to change the column width dynamically in flex datagrid][7]


  [1]: http://www.iwobanas.com/2009/06/datagrid-with-client-side-filtering-and-searching/
  [2]: http://stackoverflow.com/a/1545984/487812
  [3]: http://stackoverflow.com/a/1545984/487812
  [4]: http://stackoverflow.com/questions/4195445/flex-datagrid-column-width-one-column-to-rule-them-all
  [5]: http://stackoverflow.com/questions/1302522/flex-3-datagrid-column-width-problem
  [6]: http://stackoverflow.com/questions/1289934/flex-datagrid-column-width
  [7]: http://stackoverflow.com/questions/6033513/unable-to-change-the-column-width-dynamically-in-flex-datagrid
