             gridLayout.dataProviderCollectionChanged(event);
         
         if (gridSelection)
-            gridSelection.dataProviderCollectionChanged(event);
-            
-        // ToDo:  do we need to do any scrolling to keep either the hover
-        // indicator or the caret indicator visible?
+            gridSelection.dataProviderCollectionChanged(event);            
+        
+        if (gridDimensions && hoverRowIndex != -1)
+            updateHoverForDataProviderChange(event);
+        
+        // The data has changed so need to do this here so the grid dimensions
+        // will be accurate if setting the caret requires scrolling.
+        invalidateSize();
+        invalidateDisplayList();
         
         if (caretRowIndex != -1)
             updateCaretForDataProviderChange(event);
-        
-        if (gridDimensions && hoverRowIndex != -1)
-            updateHoverForDataProviderChange(event);    
-
-        invalidateSize();
-        invalidateDisplayList();
+
     }
     
     /**

            case CollectionEventKind.REPLACE:
            case CollectionEventKind.UPDATE:
                break;
            
            case CollectionEventKind.REFRESH:
            case CollectionEventKind.RESET:
                initializeCaretPosition();
                horizontalScrollPosition = 0;
                verticalScrollPosition = 0;
                break;
        }            
    }
    
    /**

                caretRowIndex = _dataProvider.length - 1;
            if (_columns && caretColumnIndex >= _columns.length)
                caretColumnIndex =  _columns.length - 1;

            caretSelectedItem = 
                _dataProvider && _caretRowIndex >= 0 ?
                _dataProvider.getItemAt(_caretRowIndex) : null;

            dispatchCaretChangeEvent();
            caretChanged = false;        
         }
    }
    
    /**
