| | | | Browse by category |
Article ID: 705
Last updated: 11 Jun, 2018
Problem
How can I prevent the user from selecting more than one row at a time?
Cause
Action
There are several alternatives:
- Turn off the grid selection mechanism (call EnableSelection()). Add a handler for mouse clicks yourself (OnLButtonClickedRowCol()) and then call SelectRange() to select the one row.
- Another solution is to override CanChangeSelection() as follows:
BOOL CMyGrid::CanChangeSelection(CGXRange* pRange, BOOL bIsDragging, BOOL bKey) { |
|||
if (pRange != NULL && pRange->GetHeight() > 1) | |||
return FALSE; | |||
return CGXGridCore::CanChangeSelection(pRange, bIsDragging, bKey); | |||
} |
This article was:
Helpful |
Not helpful
Report an issue
Article ID: 705
Last updated: 11 Jun, 2018
Revision: 3
Views: 2634
Posted: 23 Jan, 2001 by
Meltreger B.
Updated: 11 Jun, 2018 by
Meltreger B.
Others in this category
Powered by KBPublisher (Knowledge base software)