In diesem Abschnitt werden die verwendbaren Controls mit Beispielen gezeigt. Die Beispiele teilen sich – wenn notwendig – auf in den Teil, der das Steuerelement definiert und den Teil, der das Property im Model zeigt.

Gruppe

// Control
GroupControl group = new GroupControl
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "",
};

Statischer Text

// Control
StaticLabelControl staticLabelControl = new StaticLabelControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Static Control",
    LabelText = "Label Text",
};

Leeres Element

// Control
EmptyControl empty = new EmptyControl()
{
    Id = "[Insert Unique ID]".ToGuid()
};

Text- und Zahleingabe

// Control
TextEditControl text = new TextEditControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Text",
    OrmFieldName = "Text"
};
// Model Property
public String Text { get; set; }

Passworteingabe

// Control
PasswordControl password = new PasswordControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Password",
    OrmFieldName = "Password"
};
// Model Property
public String Password { get; set; }

Zahleingabe mit Spin-Buttons

// Control
SpinEditControl spin = new SpinEditControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Spin",
    OrmFieldName = "Spin",
    MinValue = 5,
    MaxValue = 30
};
// Model Property
public Int16 Spin { get; set; }

Zahleingabe als Schieberegler

// Control
TrackbarControl trackbar = new TrackbarControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Trackbar",
    OrmFieldName = "Trackbar",
    MinValue = 0,
    MaxValue = 100,
    SmallTickFrequency = 5,
    LargeTickInterval = 25
};
// Model Property
public Int32 Trackbar { get; set; }

Texteingabe mit Link im Lesemodus

// Control
HyperlinkEditControl hyperLink = new HyperlinkEditControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Hyper link",
    OrmFieldName = "HyperLink"
};
// Model Property
public String HyperLink { get; set; }

Eingabe Telefonnummer mit Wählfunktion im Lesemodus

// Control
CTILinkEditControl phone = new CTILinkEditControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Phone",
    OrmFieldName = "Phone"
};
// Model Property
public String Phone { get; set; }

IBAN Eingabe

// Control
IBANControl iban = new IBANControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "IBAN",
    OrmFieldName = "IBAN"
};
// Model Property
public String IBAN { get; set; }

BIC Eingabe

// Control
BICControl bic = new BICControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "BIC",
    OrmFieldName = "BIC"
};
// Model Property
public String BIC { get; set; }

Dezimaleingabe mit Währungssymbol

// Control
CurrencyControl currency = new CurrencyControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Currency",
    OrmFieldName = "Currency"
};
// Model Property
public Decimal Currency { get; set; }

Mehrzeilige Texteingabe

// Control
MemoControl memo = new MemoControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Memo",
    Height = 75,
    OrmFieldName = "Memo"
};
// Model Property
public String Memo { get; set; }

Datums- und Zeiteingabe

// Control
DateEditControl dateTime = new DateEditControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Date time",
    ShowTimeSection = true,
    OrmFieldName = "DateTime"
};
// Model Property
public DateTime DateTime { get; set; }

Zeiteingabe

// Control
TimeEditControl time = new TimeEditControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Time",
    OrmFieldName = "Time"
};
// Model Property
public DateTime Time { get; set; }

Einzelne Checkbox (Boolean)

// Control
CheckEditControl checkBox = new CheckEditControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Check box",
    OrmFieldName = "CheckBox"
};
// Model Property
public Boolean CheckBox { get; set; }

Auswahlwerteliste über Checkboxen

// Control
EnumCheckboxListControl cblist = new EnumCheckboxListControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Enum check box list",
    OrmFieldName = "EnumSalutation",
    RepeatColumns = 3
};
// Model Property
public List<EnumSalutationsValue> EnumSalutation { get; set; }

Auswahlwerteliste über Radio-Buttons

// Control
EnumRadioButtonListControl rblist = new EnumRadioButtonListControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Enum radio button list",
    OrmFieldName = "EnumAddressType",
    RepeatColumns = 2,
    RepeatDirection = EnumChoiceListRepeatDirection.Values.Vertical
};
// Model Property
public EnumAddressTypesValue EnumAddressType { get; set; }

Auswahlwerteliste über eine Listbox

// Control
EnumListboxControl lblist = new EnumListboxControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Enum list box",
    OrmFieldName = "EnumTitles"
};
// Model Property
public List<EnumTitlesValue> EnumTitles { get; set; }

Auswahlwerteliste über eine Tokenauswahl

// Control
EnumTokenboxControl lblist = new EnumTokenboxControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Enum list box",
    OrmFieldName = "EnumTitles"
};
// Model Property
public List<EnumTitlesValue> EnumTitles { get; set; }

Auswahlwerteliste über eine Combobox

// Control
EnumComboboxControl colist = new EnumComboboxControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Enum combobox",
    OrmFieldName = "EnumCTIProtocol"
};
// Model Property
public EnumCTIProtocolsValue EnumCTIProtocol { get; set; }

Auswahl eines Wertes mit einem eigenen Datenprovider

Wie Datenprovider implementiert werden finden sie hier

// Control mit eigenem Datenprovider
ComboBoxControl comboBox = new ComboBoxControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Combo box",
    NameOverride = "ComboBox",
    DataProviderProperties = new CDPEnumValuesProperties(masterGuid: EnumCountries.Guid)
};
// Model Property
public String ComboBox { get; set; }

Auswahl und Erfassung einer Übersetzung

// Control
TranslationControl translation = new TranslationControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Translation",
    NameOverride = "Translation"
};
// Model Property
public String Translation { get; set; }

Eingabe formatierter Text

// Control
HTMLControl htmlControl = new HTMLControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "HTML Content",
    OrmFieldName = "HTMLContent"
};
// Model Property
public String HTMLContent { get; set; }

Darstellung einer Ansicht

// Control
GridInDialogControl grid = new GridInDialogControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Grid",
    ControlName = "Grid",
    GridConfigurationGuid = "[INSERT GRID CONFIGURATION ID]"
};

Möchte man eine Ansicht haben, welche programmatisch definiert ist, kann eine dynamische Konfiguration angelegt werden. In diesem Fall kann auch ein eigener Datenprovider für die Ansicht erstellt werden.

Erfassung einer Anschrift

// Control
AddressControl address = new AddressControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Address",
};
address.GetControls();
address.AddressLine1Control.OrmFieldName = "AddressLine1";
address.AddressLine2Control.OrmFieldName = "AddressLine2";
address.AddressLine2Control.Visible = true;
address.PostalCodeControl.OrmFieldName = "PostalCode";
address.CityControl.OrmFieldName = "City";
address.StateControl.OrmFieldName = "State";
address.CountryControl.OrmFieldName = "Country";
// Model Property
public String AddressLine1 { get; set; }
public String AddressLine2 { get; set; }
public String PostalCode { get; set; }
public String City { get; set; }
public String State { get; set; }
public EnumCountriesValue Country { get; set; }

Erfassung eines vollständigen Personennamens

// Control
NameBlockControl name = new NameBlockControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Name"
};
name.GetControls();
name.SalutationControl.OrmFieldName = "Salutation";
name.SalutationTitleControl.OrmFieldName = "SalutationTitle";
name.TitleControl.OrmFieldName = "Title";
name.FirstNameControl.OrmFieldName = "FirstName";
name.MiddleNameControl.OrmFieldName = "MiddleName";
name.LastNameControl.OrmFieldName = "LastName";
name.SuffixControl.OrmFieldName = "Suffix";
// Model Property
public EnumSalutationsValue Salutation { get; set; }
public EnumTitlesValue SalutationTitle { get; set; }
public List<EnumTitlesValue> Title { get; set; }
public String FirstName { get; set; }
public String MiddleName { get; set; }
public String LastName { get; set; }
public EnumSuffixesValue Suffix { get; set; }

Container für Tabs

// Control
TabContainerControl tabContainer = new TabContainerControl
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "",
    WrapContentAtWidth = 500,
    StretchLastItem = true,
    ColSpan = 1,
    ColumnCount = 1
};

Einzelner Tab

// Control
TabControl tab1 = new TabControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Tab 1",
    ColSpan = 1,
    ColumnCount = 3, // biggest size
};

Button Gruppe

// Control
ButtonGroupControl buttonGroup = new ButtonGroupControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    NumberOfColumns = 2,
};

Button

// Control
ButtonControl button = new ButtonControl()
{
    Id = "[Insert Unique ID]".ToGuid(),
    Caption = "Button",
    MethodIdToExecuteOnButtonClick = "BA.Training.ClientActionMyAction",
};