<< Return to Main Index

< Return to Class Index

CGXGridCore::OnStartSelection

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

nRow

Specifies the row id.

nCol

Specifies the column id.

flags

MK_SHIFT    Set if the SHIFT key is down.

point

Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper-left corner of the window.

Return Value

TRUE if the user can start selecting cells at the given cell; FALSE to prevent selecting cells.

Remarks

This method is called when the user has pressed the mouse in a cell and starts selecting cells.

You can override this method if you want to restrict the area where the user can select cells (you will then also have to override CanChangeSelection). If you want to disable selecting cells globally, you should call GetParam( )->EnableSelection(...).

Example

This example only allows selecting cells for rows 5 to 10:

BOOL CSampleView::OnStartSelection(ROWCOL nRow, ROWCOL nCol, UINT flags, CPoint point)
{
   nRow, nCol, point, flags;

   return nRow >= 5 && nRow <= 10;
}

See Also

CGXGridCore::CanChangeSelection CGXGridCore::OnChangedSelection CGXGridParam::EnableSelection

CGXGridCore

Class Overview | Class Members