          */
         public function set caretRowIndex(value:int):void
         {
+            _oldCaretRowIndex = _caretRowIndex;
+
             if (_caretRowIndex == value)
                 return;
             
-            _oldCaretRowIndex = _caretRowIndex;
             _caretRowIndex = value;
             
             caretChanged = true;

            return dataProvider.getItemIndex(item);
        }
        
        /**
         *  @private
         */
        private function getVisibleItemRenderer(rowIndex:int, columnIndex:int):IVisualElement

         *  @productversion Flex 4.5
         */
        public function selectAll():Boolean
        {           
            const selectionChanged:Boolean = gridSelection.selectAll();
            if (selectionChanged)
            {               
                // Remove the caret.
                caretRowIndex = -1;
                caretColumnIndex = -1;
                
                invalidateDisplayList()
                dispatchFlexEvent(FlexEvent.VALUE_COMMIT);
            }
 
            return selectionChanged;
        }
        
        /**
