Browse by category:
|| | ||
How can I prevent the user from selecting more than one row at a time?
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 CGXGridCore::CanChangeSelection(pRange, bIsDragging, bKey);|
|Objective Grid: Displaying selected cells with a user-defined...||Objective Grid: Programmatically selecting a row after a...|