ComboBox

in namespace DotVVM.Framework.Controls.Bootstrap4

Extends the built-in ComboBox control to allow applying Bootstrap CSS classes.

Usage & Scenarios

Extends the builtin ComboBox control to allow sizing.

https://getbootstrap.com/docs/4.3/components/forms/#sizing

Sample 1: ComboBox Sizing

Use the Size property to set the size of the ComboBox.

<bs:ComboBox Size="Small" DataSource="{value: Fruits}"  SelectedValue="{value: SelectedFruit}"/>

<bs:ComboBox Size="Default" DataSource="{value: Fruits}"  SelectedValue="{value: SelectedFruit}"/>

<bs:ComboBox Size="Large" DataSource="{value: Fruits}"  SelectedValue="{value: SelectedFruit}"/>
using DotVVM.Framework.ViewModel;

namespace DotvvmWeb.Views.Docs.Controls.bootstrap4.ComboBox.sample1
{
    public class ViewModel : DotvvmViewModelBase
    {
        public string[] Fruits { get; set; } = { "Apple", "Banana", "Orange" };

        public string SelectedFruit { get; set; }
    }
}

Properties

Name Type Description Notes Default Value
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
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
False
property icon FormControlStyle BootstrapFormStyle Gets or sets the Bootstrap form style of the control.
attribute
inner element
static value
bindable
default
Default
property icon ItemTextBinding IValueBinding The expression of DataSource item that will be displayed in the control.
attribute
inner element
static value
bindable
default
null
property icon ItemTitleBinding IValueBinding The expression of DataSource item that will be placed into html title attribute.
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 SelectedValue Object Gets or sets the value of the selected item.
attribute
inner element
static value
bindable
default
null
property icon Size Size Gets or sets the size of the ComboBox.
attribute
inner element
static value
bindable
default
Default

Events

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

HTML produced by the control