In MS Excel, the selection will be discarded when user moves the current cell with the arrow keys. How can I force the grid to behave the same way.
You should override the MoveCurrentCellEx method.
Example:
BOOL CMyGrid::MoveCurrentCellEx(int direction, UINT nCell)
{
BOOL bCtl = GetKeyState(VK_CONTROL) & 0x8000;
BOOL bShift = GetKeyState(VK_SHIFT) & 0x8000;
if (!GetParam()->IsEnableSelection(GX_SELKEYBOARD)
|| !bCtl && !bShift)
SelectRange(CGXRange().SetTable(), FALSE);
return CGXGridCore::MoveCurrentCellEx(direction, nCell);
}