                 selectColumnHeader(headerIndex);
             }
         }
-        else if (event.keyCode == Keyboard.SPACE)
+        else if (keyCode == Keyboard.SPACE)
         {
             if (sortableColumns && columns[headerIndex].sortable)
             {

                selectColumnHeader(headerIndex);
            }
        }
        else if (event.keyCode == Keyboard.RIGHT)
        {
            newColumnIndex = viewDisplayableColumnAtOffset(headerIndex, +1);
            if (newColumnIndex != -1)

                dropIndexFound = true;
                isHeaderDragOutside = false;

                // If the mouse pointer over the right (ltr) or left (rtl) half
				// of the column, the drop indicator should be shown before the next column.
                if (pt.x > (columnXPos + headerInfo.column.width/2) || 
                    //Column groups which are partially visible should 
                    //show drag indicator at the right end only
