     {
         const oldCaretColumnIndex:int = caretColumnIndex;
         const location:int = event.location;
-        var itemsLength:int;
+        const itemsLength:int = event.items ? event.items.length : 0;
         
         switch (event.kind)
         {
             case CollectionEventKind.ADD:
                 if (oldCaretColumnIndex >= location)
-                    caretColumnIndex += event.items.length;
+                    caretColumnIndex += itemsLength;
                 break;
             
             case CollectionEventKind.REMOVE:
                 if (oldCaretColumnIndex >= location)
                 {
-                    itemsLength = event.items.length;
                     if (oldCaretColumnIndex < (location + itemsLength))
                         caretColumnIndex = _columns.length > 0 ? 0 : -1; 
                     else

            }                                
        }

        gridDimensions.columnsCollectionChanged(event);
        if (dataProvider)
            gridDimensions.rowCount = dataProvider.length;
        
        if (gridLayout)
            gridLayout.columnsCollectionChanged(event);

            case CollectionEventKind.REMOVE:
                if (oldCaretRowIndex >= location)
                {
                    if (oldCaretRowIndex < (location + itemsLength))
                        caretRowIndex = _dataProvider.length > 0 ? 0 : -1; 
                    else
