             for (var i:int = 0; i < headerItems.length; i++)
                 headerItems[i].setActualSize(headerItems[i].width, maxHeaderHeight);
 
+            for (i = 0; i < oldHeaderItems.length; i++)
+            {
+                item = oldHeaderItems[i];
+                if (item && headerItems.indexOf(item) == -1)
+                {
+                    // if it is parented by us, remove it (could be in lockedColumns header)
+                    if (item.parent == this)
+                        removeChild(DisplayObject(item));
+                }
+            }
             while (headerItems.length > colNum)
             {
                 // remove extra columns
                 extraItem = headerItems.pop();
-                removeChild(DisplayObject(extraItem));
+                // if it is parented by us, remove it (could be in lockedColumns header)
+                if (extraItem.parent == this)
+                    removeChild(DisplayObject(extraItem));
             }
         }
         var headerBG:UIComponent =

            lines.removeChildAt(lines.numChildren - 1);
            separators.pop();
        }
    }
    
     /**

            var c:DataGridColumn;

            var maxHeaderHeight:Number = 0;
            // copy current list of renderers
            var oldHeaderItems:Array = headerItems.slice();

            while (cols && colNum < cols.length)
            {
                c = cols[colNum];
                item = c.cachedHeaderRenderer;
                if (!item)
                {
                    item = dataGrid.createColumnItemRenderer(c, true, c);
                    item.styleName = c;
                    c.cachedHeaderRenderer = item;
                }
                rowData = new DataGridListData((c.headerText != null) ? c.headerText : c.dataField, 
                                                                c.dataField, colNum, uid, dataGrid, 0);
                if (item is IDropInListItemRenderer)
                    IDropInListItemRenderer(item).listData = rowData;
                item.data = c;
                item.visible = true;
                // if it isn't parented by us, add it (could be in lockedColumns header)
                if (item.parent != this)
                    addChild(DisplayObject(item));
                headerItems[colNum] = item;
                // set prefW so we can compute prefH
                item.explicitWidth = ww = c.width;
