Objective Grid: Clearing the selection when the user moves the active cell

Article ID: 560
Last updated: 16 Apr, 2018
Article ID: 560
Last updated: 16 Apr, 2018
Revision: 3
Views: 2505
Posted: 09 Jan, 2001
by Meltreger B.
Updated: 16 Apr, 2018
by Meltreger B.

Problem


When I have selected a range of cells, I expect the selection to clear when I move the active cell without keeping the [Shift] key down. How can I make Objective Grid clear the selection when I move the active cell?


Cause



Action


You could override OnMovedCurrentCell( ) as follows.

Example:

void CGridSampleView::OnMovedCurrentCell( ROWCOL nRow, ROWCOL nCol )
{
BOOL bShift = GetKeyState(VK_SHIFT) & 0x8000;

if (!IsSelectingCells() && !bShift)

SetSelection(0);
CGXGridCore::OnMovedCurrentCell( nRow, nCol );
}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 560
Last updated: 16 Apr, 2018
Revision: 3
Views: 2505
Posted: 09 Jan, 2001 by Meltreger B.
Updated: 16 Apr, 2018 by Meltreger B.

Others in this category