             case NavigationUnit.HOME:
             {
                 caretRowIndex = 0;
-                caretColumnIndex = isCellSelectionMode() ? 0 : -1; 
+                caretColumnIndex = isCellSelectionMode() ? grid.getNextVisibleColumnIndex(-1) : -1; 
                 break;
             }
                 
             case NavigationUnit.END:
             {
                 caretRowIndex = rowCount - 1;
-                caretColumnIndex = isCellSelectionMode() ? columnCount - 1 : -1;
+                caretColumnIndex = isCellSelectionMode() ? grid.getPreviousVisibleColumnIndex(columnCount) : -1;
                 
                 // The heights of any rows that have not been rendered yet are
                 // estimated.  Force them to draw so the heights are accurate.

                if (isCellSelectionMode())
                {
                    if (grid.caretColumnIndex + 1 < columnCount)
                        caretColumnIndex++;
                }
                break;
            } 

                if (isCellSelectionMode())
                {
                    if (grid.caretColumnIndex > 0)
                        caretColumnIndex = grid.getPreviousVisibleColumnIndex(caretColumnIndex);
                }
                break;
            }
