      *  The sort or filter on the collection changed.
      */
     private function dataProviderCollectionRefresh(event:CollectionEvent):void
-    {
+    {        
         // Not preserving selection so this is similiar to a RESET.
-        if (!preserveSelection)
+        if (!selectedItem)
         {            
             removeSelection();
             ensureRequiredSelection();
             return;
         }
         
-        const rowCount:int = getGridDataProviderLength(); 
-        var crIndex:int = 0
-        while (crIndex < cellRegions.length)
-        {
-            var cr:CellRect = cellRegions[crIndex];
-            
-            // clip or remove any cell regions that extend beyond the
-            // new number of rows
-            if (cr.bottom > rowCount)
-            {
-                _selectionLength = -1;  // recalculate               
-                if (cr.y >= rowCount)
-                {
-                    cellRegions.splice(crIndex, 1);
-                    continue;
-                }
-                else
-                {
-                    cr.height = rowCount - cr.y;
-                }
-            }
-            crIndex++;
-        }
-        
-        ensureRequiredSelection();
+        // Is the selectedItem still in the collection?
+        const view:ICollectionView = event.currentTarget as ICollectionView;       
+        if (view && view.contains(selectedItem))
+        {
+            // Selection is in view so move it to the new row location.
+            const newRowIndex:int = grid.dataProvider.getItemIndex(selectedItem);
+            if (selectionMode == GridSelectionMode.SINGLE_ROW)
+            {
+                internalSetCellRegion(newRowIndex);
+            }
+            else
+            {
+                var oldSelectedCell:CellPosition = allCells()[0];
+                internalSetCellRegion(newRowIndex, oldSelectedCell.columnIndex);
+            }            
+        }
+        else
+        {
+            // Selection not in current view so remove selection.
+            removeSelection();
+            ensureRequiredSelection();
+            return;            
+        }
     }
                 
     /**

            return;
        
        _preserveSelection = value;
    }
    
    //----------------------------------

            // length.
            if (_selectionLength >= 0)
                _selectionLength--;
            
            selectedItem = null;
        }
    }
    
