ActivateEditor: TriState;
ActivateEditor: Prognoz.Platform.Interop.ForeSystem.TriState;
The ActivateEditor property determines cell editor activation mode.
Available values:
TriState.Undefined. The mode is not determined.
TriState.OnOption. The cell editor is activated when the cell gets focus.
TriState.OffOption. Default value. The cell editor is activated on double mouse click on a cell.
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.
If the cell range is selected, the editor is not 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: 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.ActivateEditor := 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.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.ForeSystem;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
Report: IPrxReport;
BM: IBindingManager;
ComboBoxBinding: IBindingComboBox;
Tab: ITabSheet;
Style: ITabCellStyle;
Begin
// Get current repository
mb := Params.Metabase;
// 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.ActivateEditor := TriState.tsOnOption;
// Save changes
(Report As IMetabaseObject).Save();
End Sub;
See also: