virtual void SelectRange(const CGXRange& range, BOOL bSelect = TRUE, BOOL bUpdate = TRUE);
range
Reference to a range of cells to be selected or deselected.
bSelect
TRUE if the range shall be selected; FALSE if the range shall be deselected.
bUpdate
TRUE if the change grid shall be made visible; FALSE if the grid shall not be updated.
Selects or deseclects a range of cells, rows or columns and inverts the cells.
This method allows you to turn on/off the selection for a specific range of cells.
The rangelist is adapted by calling StoreSelectRange; the display is updated with a call to UpdateSelectRange.
There is also another method SetSelection which allows you to select ranges. SetSelection is more advanced and only works with ranges stored in the range-list.
SelectRange is simpler in that you can directly pass a range and you don’t have to take care of allocating new ranges and adding them to the range-list.
Control-Factory Specific ->
This method has been implemented using the abstraction mechanism as discussed in the chapter "Reducing the size of your application" in the user's guide. A call to the ImplementUserSelectRange method from within the control factory class' InitializeGridComponents method will make the concrete implementation of this method available to your application.
If no concrete implementation is available this method performs no action. A warning will be displayed in the debug window.
END Control-Factory Specific
This example shows you how you can select/deselect cells:
// Select column 3-5
SelectRange(CGXRange( ).SetCols(3,5), TRUE);
// Select whole table
SelectRange(CGXRange( ).SetTable( ), TRUE),
// Deselect whole table
SelectRange(CGXRange( ).SetTable( ), FALSE);
// Select a given range of cells
SelectRange(CGXRange(1,1,3,4), TRUE);
CGXGridCore::SetSelection CGXGridCore::StoreSelectRange CGXGridCore::UpdateSelectRange
Class Overview | Class Members