Objective Grid: Preventing cell selection with the mouse

Article ID: 414
Last updated: 27 Apr, 2018
Article ID: 414
Last updated: 27 Apr, 2018
Revision: 3
Views: 2696
Posted: 11 Jan, 2001
by Meltreger B.
Updated: 27 Apr, 2018
by Meltreger B.

Problem

 


How can I prevent the user from selecting cells with the mouse?

 

 


Cause

 


 

 


Action

 


Take a look at CGXGridParam::EnableSelection( ).

You could, for example, call:

GetParam( )->EnableSelection(FALSE);

So, you can only select the current cell.

If you want to disable selecting full columns you can call

GetParam( )->EnableSelection((WORD) (GX_SELFULL & ~GX_SELCOL & ~GX_SELTABLE));

If you want to disable selecting cells only for specific columns, you can override CGXGridCore::OnStartSelection()

virtual BOOL OnStartSelection(ROWCOL nRow, ROWCOL nCol, UINT flags, CPoint point);

and return FALSE if nRow, nCol point to a specific cell.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 414
Last updated: 27 Apr, 2018
Revision: 3
Views: 2696
Posted: 11 Jan, 2001 by Meltreger B.
Updated: 27 Apr, 2018 by Meltreger B.

Others in this category