OperationMode Property
Applies To
fpSpread control
Description
Sets or returns the operation mode of the sheet.
Syntax
long CSpreadSheet::GetOperationMode( );
void CSpreadSheet::SetOperationMode(long value);
[form.]fpSpread.OperationMode[ = setting%]
Remarks
The following settings are available:
Setting | Description | Constant |
---|---|---|
0 - Normal | (Default) Performs default sheet operations | OperationModeNormal |
1 - Read Only | Places sheet in read-only mode (Within this mode, there is no current active cell.) |
OperationModeRead |
2 - Row Mode | Places sheet in row mode | OperationModeRow |
3 - Single Select | Sets sheet to operate like a single-selection list box | OperationModeSingle |
4 - Multi Select | Sets sheet to operate like a multiple-selection list box | OperationModeMulti |
5 - Extended Select | Sets sheet to operate like an extended-selection list box | OperationModeExtended |
This setting is applied to the current sheet setting unless you first set the Sheet property to specify the sheet for which you are setting the property.
Do not use multiple-selection (setting 4 (Multi Select)) or extended-selection (setting 5 (Extended Select)) operation mode when the fpSpread control is in virtual mode (the VirtualMode property is set to True).
When the OperationMode property is set to 2 (Row Mode), the sheet exhibits the following behaviors:
- A bar appears on the current active row. When the user begins typing data, the data is entered in the active cell, and the sheet removes the highlight bar. The user can click cells within the row to make them the active cell. Once the user leaves the row, the highlight bar reappears.
- The EnterRow and LeaveRow events occur as the user moves between rows.
- The setting of the ButtonDrawMode property is ignored. Instead, while the highlight bar is visible, no buttons are drawn. While the row is being edited, all the buttons in the current row are drawn.
- If you set the AllowDragDrop property to True and you drag and drop a cell or block of cells, the entire row containing the selected cell or cells is dragged and dropped.
When the OperationMode property is set to 3 (Single Select), 4 (Multi Select), or 5 (Extended Select), the sheet operates like a list box and it exhibits the following behaviors:
- The user cannot edit data in the sheet.
- A highlight bar appears on the selected row or rows.
- The setting of the ButtonDrawMode property is ignored. No buttons are displayed for any cells.
- If you set the AllowDragDrop property to True, drag-and-drop operations are performed on entire rows.
- You can use the SelModeIndex, SelectionCount, and SelModeSelected properties to set and return the selected row or rows within the sheet.
Spread Designer
Choose the Sheet menu, then the Operation menu, select the Sheet Mode tab, and then choose an option in the Spreadsheet Operation group box in the Sheet Settings dialog box.
In the Spread Designer the OperationMode property is temporarily reset to 0 (Normal) when in design mode, to assist you in the design process. When you switch to run-time mode, the sheet behaves according to the setting you have chosen for this property.
Data Type
Integer (Enumerated)
See Also
Specifying the Operation Mode
Copying Data Using Drag-and-Drop
Moving Data Using Drag and Drop
Specifying When Buttons Appear
Allowing Users to Drag and Drop Cells
AllowDragDrop, ButtonDrawMode, SelectionCount, SelModeIndex, SelModeSelected, Sheet, VirtualMode properties
DLL Correspondence
SSGetOperationMode, SSSetOperationMode functions