Items: String;
Items: String;
The Items property determines the ITEMS parameter value in binding string.
The ITEMS parameter determines collection of combobox elements. Elements are specified as a character string and are separated by the character, which is determined in the Separators property.
The Items property is available if the ItemsDefined property is set to True. If the Items property is changed, the ItemsDefined property is automatically set to True.
Function CreateComboBoxBidning(Paramarray Items: Array Of String): String;
Var
BM: IBindingManager;
ComboBoxBinding: IBindingComboBox;
s, LineItems: String;
Begin
BM := New BindingManager.Create;
ComboBoxBinding := BM.CreateByUi("ComboBox") As IBindingComboBox;
//Form a string from elements separated by the ; character
For Each s In Items Do
LineItems := String.Concat(LineItems, s + ";");
End For;
//Take off the last separator character
LineItems := LineItems.SubString(0, LineItems.Length - 1);
//Elements
ComboBoxBinding.Items := LineItems;
//Ability to edit
ComboBoxBinding.ListMode := False;
//Delimiter for elements
ComboBoxBinding.Separators := ";";
//Default value
ComboBoxBinding.Value := Items[0];
Return ComboBoxBinding.AsString;
End Function CreateComboBoxBidning;
This function generates binding string to use value editor as a combobox. The list elements are sent as input parameters array of string type, the ; character will be used as a separator. It is possible to input value manually in combobox.
Imports Prognoz.Platform.Interop.ForeSystem;
Function CreateComboBoxBidning(Paramarray Items: Array Of String): String;
Var
BM: BindingManager = New BindingManagerClass();
ComboBoxBinding: IBindingComboBox;
s, LineItems: String;
Begin
ComboBoxBinding := BM.CreateByUi("ComboBox") As IBindingComboBox;
//Form a string from elements separated by the ; character
For Each s In Items Do
LineItems := String.Concat(LineItems, s + ";");
End For;
//Take off the last separator character
LineItems := LineItems.SubString(0, LineItems.Length - 1);
//Elements
ComboBoxBinding.Items := LineItems;
//Ability to edit
ComboBoxBinding.ListMode := False;
//Delimiter for elements
ComboBoxBinding.Separators := ";";
//Default value
ComboBoxBinding.Value := Items[0];
Return ComboBoxBinding.AsString;
End Function;
This function generates binding string to use value editor as a combobox. The list elements are sent as input parameters array of string type, the ; character will be used as a separator. It is possible to input value manually in combobox.
See also: