         var oldVerticalScrollBar:Object = verticalScrollBar;
 
         var rowCount:int = listItems.length;
-        if (rowCount + headerItems.length== 0)////TODO
+		// check whether the header items are present
+		if (rowCount + getHeaderItemsLength() == 0)
         {
             // Get rid of any existing scrollbars.
             if (oldHorizontalScrollBar || oldVerticalScrollBar)


import mx.collections.CursorBookmark;
import mx.collections.ICollectionView;
import mx.collections.IViewCursor;
import mx.collections.ItemResponder;
import mx.collections.ISort;
import mx.collections.ISortField;
import mx.collections.Sort;
import mx.collections.SortField;
import mx.collections.errors.ItemPendingError;

        }
        return newArray;
    }
	
	/**
	 * Get the length of the header items
	 * 
	 *  @private
	 */
	protected function getHeaderItemsLength():int
	{
		return headerItems.length;
	}
    
    /**
     *  @private
