 import mx.core.mx_internal;
 import mx.events.CollectionEvent;
 import mx.events.CollectionEventKind;
+import mx.events.PropertyChangeEvent;
 import mx.styles.ISimpleStyleClient;
 
 import spark.components.ColumnHeaderBar;

                return dataProviderCollectionReset(event);
                
            case CollectionEventKind.UPDATE:
            case CollectionEventKind.REPLACE:
                break;
        }

    private function dataProviderCollectionReset(event:CollectionEvent):Boolean
    {
        clearVirtualLayoutCache();
        return true;
    }
    
    /**
     *  @private
     *  Called in response to an item being updated in the dataProvider. Checks
     *  to see if the item is visible and invalidates the grid if it is. Otherwise, 
     *  do nothing.
     */
    private function dataProviderCollectionUpdate(event:CollectionEvent):Boolean
    {
        var data:Object;
        const itemsLength:int = event.items.length;
        const itemRenderersLength:int = visibleItemRenderers.length;
        
        for (var i:int = 0; i < itemsLength; i++)
        {
            data = PropertyChangeEvent(event.items[i]).source;
            
            for (var j:int = 0; j < itemRenderersLength; j++)
            {
                var renderer:IGridItemRenderer = visibleItemRenderers[j] as IGridItemRenderer;
                if (renderer && renderer.data == data)
                {
                    this.freeItemRenderer(renderer);
                    visibleItemRenderers[j] = null;
                }
            }
        }
        return true;
    }
    
