FormControlComboBox

in namespace DotVVM.Bootstrap5.Controls

Extends the ComboBox control for usage in Form.

Usage & Scenarios

A special version of the ComboBox control that can be used in Form.

See ComboBox for more info on how to use this control.

https://getbootstrap.com/docs/5.2/forms/form-control

Sample 1: Basic Usage

<bs:FormControlComboBox IsMultiple="true" 
                        DataSource="{value: Strings}" 
                        SelectedValue="{value: SelectedString}" 
                        LabelText="Basic" 
                        OptionCount="3" />
public class ViewModel : DotvvmViewModelBase
{
    public List<string> Strings { get; set; } = new List<string> { "one", "two", "three" };
    public string SelectedString { get; set; }
}

Properties

Name Type Description Notes Default Value
property icon ControlSizeAll String Gets or sets the size of the control for all screen sizes.
attribute
inner element
static value
bindable
default
null
property icon ControlSizeLarge String Gets or sets the size of the control for large screen sizes.
attribute
inner element
static value
bindable
default
null
property icon ControlSizeMedium String Gets or sets the size of the control for medium screen sizes.
attribute
inner element
static value
bindable
default
null
property icon ControlSizeSmall String Gets or sets the size of the control for small screen sizes.
attribute
inner element
static value
bindable
default
null
property icon ControlSizeXLarge String Gets or sets the size of the control for extra large screen sizes.
attribute
inner element
static value
bindable
default
null
property icon ControlSizeXXLarge String Gets or sets the size of the control for extra extra large screen sizes.
attribute
inner element
static value
bindable
default
null
property icon DataSource Object Gets or sets the source collection or a GridViewDataSet that contains data in the control.
attribute
inner element
static value
bindable
default
null
property icon EmptyItemText String Text displayed when no value is selected.
attribute
inner element
static value
bindable
default
null
property icon Enabled Boolean Gets or sets a value indicating whether the control is enabled and can be modified.
attribute
inner element
static value
bindable
default
null
property icon FormControlCssClass String Gets or sets the CSS class to apply to the form control element.
attribute
inner element
static value
bindable
default
null
property icon FormControlType FormControlType? Gets or sets the available form control type.
attribute
inner element
static value
bindable
default
null
property icon HelpContent List<DotvvmControl> Gets or sets a custom template for for the help text. Cannot be combined with a `HelpText` property.
attribute
inner element
static value
bindable
default
null
property icon HelpText String Gets or sets a plain text for the help text. Cannot be combined with a `HelpContent` property.
attribute
inner element
static value
bindable
default
null
property icon ItemTextBinding IValueBinding<String> The expression of DataSource item that will be displayed in the control.
attribute
inner element
static value
bindable
default
null
property icon ItemValueBinding IValueBinding The expression of DataSource item that will be passed to the SelectedValue property when the item is selected.
attribute
inner element
static value
bindable
default
null
property icon LabelContent List<DotvvmControl> Gets or sets a custom template for for the control label. Cannot be combined with a `LabelText` property.
attribute
inner element
static value
bindable
default
null
property icon LabelSizeAll String Gets or sets the size of the label for all screen sizes.
attribute
inner element
static value
bindable
default
null
property icon LabelSizeLarge String Gets or sets the size of the label for large screen sizes.
attribute
inner element
static value
bindable
default
null
property icon LabelSizeMedium String Gets or sets the size of the label for medium screen sizes.
attribute
inner element
static value
bindable
default
null
property icon LabelSizeSmall String Gets or sets the size of the label for small screen sizes.
attribute
inner element
static value
bindable
default
null
property icon LabelSizeXLarge String Gets or sets the size of the label for extra large screen sizes.
attribute
inner element
static value
bindable
default
null
property icon LabelSizeXXLarge String Gets or sets the size of the label for extra extra large screen sizes.
attribute
inner element
static value
bindable
default
null
property icon LabelText String Gets or sets a plain text for the control label. Cannot be combined with a `LabelContent` property.
attribute
inner element
static value
bindable
default
null
property icon LabelType LabelType? Gets or sets the label type. Possible values are `Default` and `Floating`.
attribute
inner element
static value
bindable
default
null
property icon Layout FormControlLayout? Gets or sets the form control layout. Possible values are `Default`, `Horizontal` and `Grid`.
attribute
inner element
static value
bindable
default
null
property icon RenderLabel Boolean? Gets or sets whether the label is rendered.
attribute
inner element
static value
bindable
default
null
property icon SelectedValue IValueBinding<Object> Gets or sets the value of the selected item.
attribute
inner element
static value
bindable
default
null
property icon SelectMenuSize Int32 Gets or sets the size of the options menu.
attribute
inner element
static value
bindable
default
null
property icon Size Size? Gets or sets the size of the label and form control elements.
attribute
inner element
static value
bindable
default
null
property icon Visible Boolean Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control.
attribute
inner element
static value
bindable
default
True

Events

Name Type Description
event icon SelectionChanged ICommandBinding Gets or sets the command that will be triggered when the selection is changed.

HTML produced by the control