         if (value == oldLayout)
             return; 
 
+        if (oldLayout)
+        {
+            oldLayout.typicalLayoutElement = null;
+            oldLayout.removeEventListener("useVirtualLayoutChanged", layout_useVirtualLayoutChangedHandler);
+        }
+        // Changing the layout may implicitly change layout.useVirtualLayout
+        if (oldLayout && value && (oldLayout.useVirtualLayout != value.useVirtualLayout))
+            changeUseVirtualLayout();
         super.layout = value;    
-        if (oldLayout)
-            oldLayout.typicalLayoutElement = null;
         if (value)
         {
             // If typicalLayoutElement was specified for this DataGroup, then use


        for (var index:int = oldVirtualLayoutStartIndex; index <= oldVirtualLayoutEndIndex; index++)
        {
            // Skip the inView renderers 
            if (index >= virtualLayoutStartIndex && index <= virtualLayoutEndIndex)
            {
                index = virtualLayoutEndIndex;
                continue;

                value.typicalLayoutElement = typicalLayoutElement;
            else
                typicalLayoutElement = value.typicalLayoutElement;
            value.addEventListener("useVirtualLayoutChanged", layout_useVirtualLayoutChangedHandler);
        }
    }
    
    /**
     *  @private
     *  If layout.useVirtualLayout changes, recreate the ItemRenderers.  This can happen
     *  if the layout's useVirtualLayout property is changed directly, or if the DataGroup's
     *  layout is changed. 
     */    
    private function changeUseVirtualLayout():void
    {
        trace("DataGroup::changeUseVirtualLayout()");
        cleanUpDataProvider();
        invalidateProperties();
        useVirtualLayoutChanged = true;
    }
    
    private function layout_useVirtualLayoutChangedHandler(event:Event):void
    {
        changeUseVirtualLayout();
    }

    //----------------------------------
    //  itemRenderer
    //----------------------------------
