         if (!dataGrid.editable)
             return;
 
+        if (!isValidCellPosition(event.rowIndex, event.columnIndex))
+            return;
+        
         lastEvent = event;
         
         const eventRowIndex:int = event.rowIndex;

            itemEditorInstance.rowIndex = rowIndex;
            itemEditorInstance.column = col;
            itemEditorInstance.hasFocusableChildren = true;
            if (itemEditorInstance is ISimpleStyleClient)
                ISimpleStyleClient(itemEditorInstance).styleName = item;
            itemEditorInstance.data = item.data;
            
            grid.addElement(itemEditorInstance);
            
            // position the editor over the cell with the same size as the cell.
            itemEditorInstance.width = cellBounds.width;
            itemEditorInstance.height = cellBounds.height;
            itemEditorInstance.setLayoutBoundsPosition(localCellOrigin.x, localCellOrigin.y);
            
            if (itemEditorInstance is IInvalidating)

        
        if (event.keyCode == dataGrid.editKey)
        {
            // ignore F2 if we are already editing a cell.
            if (itemEditorInstance)
                return;
            
