             if (instance == hoverIndicator) 
                 grid.hoverIndicator = hoverIndicator;
 
-            if (instance == caretIndicator) 
+            if (instance == caretIndicator)
+            {                
                 grid.caretIndicator = caretIndicator;
-
+                
+                // Add a focus listener so we can turn the caret on and off
+                // when we get and lose focus.
+                addEventListener(FocusEvent.FOCUS_IN, dataGrid_focusHandler);
+                addEventListener(FocusEvent.FOCUS_OUT, dataGrid_focusHandler);
+                if (grid && grid.layout is GridLayout)
+                    GridLayout(grid.layout).showCaret = false;
+            }    
+            
             if (instance == selectionIndicator) 
                 grid.selectionIndicator = selectionIndicator;
         }

        
        cursorManager.removeCursor(stretchCursorID);
    }     
}
}
            columnHeaderBar.addEventListener(GridEvent.SEPARATOR_MOUSE_DRAG, separator_mouseDragHandler);
            columnHeaderBar.addEventListener(GridEvent.SEPARATOR_MOUSE_UP, separator_mouseUpHandler);  
        }       
        
        if (instance == itemEditorLayer)
        {
            // Data grid editor
            editor = createEditor();
            editor.initialize();
        }
    }
    
    /**
