ActivationEditorMode: TabActivationEditorMode;
The ActivationEditorMode property determines cell editor activation type.
To determined value editor settings, use the ITabCellStyle.Binding property.
If the value editor is not set for the cell, the editor corresponding to cell data type is activated.
Executing the example requires that the repository contains a regular report with the REPORT_ACT_EDITOR identifier.
Add links to the Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
mb: IMetabase;
Report: IPrxReport;
BM: IBindingManager;
ComboBoxBinding: IBindingComboBox;
Tab: ITabSheet;
Style, UStyle: ITabCellStyle;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get regular report
Report := mb.ItemById("REPORT_ACT_EDITOR").Edit As IPrxReport;
// Create and set up value editor as a drop-down list
BM := New BindingManager.Create;
ComboBoxBinding := BM.CreateByUi("ComboBox") As IBindingComboBox;
ComboBoxBinding.Items := "1;2;3;4;5";
ComboBoxBinding.ListMode := True;
ComboBoxBinding.Separators := ";";
ComboBoxBinding.Value := "3";
// Get cell style in the top left corner of available report sheet
Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
Style := Tab.Cell(0, 0).Style;
// Specify that created value editor is used for cell
Style.Binding := ComboBoxBinding.AsString;
// Specify that editor is activated if cell gets focus
Style.ActivationEditorMode := TabActivationEditorMode.OnFocus;
// Get style of the other cell of report active sheet
UStyle := Tab.Cell(1, 1).Style;
// Set that cell will not be selected
UStyle.Unselectable := TriState.OnOption;
// Save changes
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the value editor is set up for the cell as a drop-down list in the top left corner of the available report sheet. This editor is activated when the cell gets focus. On viewing the report, on selecting the cells, one cell will not be selected.
See also: