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.
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 | |
---|---|---|---|---|---|
Attributes | Dictionary<String,Object> |
attribute
static value
|
null | ||
ClientIDMode | ClientIDMode | Gets or sets the client ID generation algorithm. |
attribute
static value
|
Static | |
DataContext | Object | Gets or sets a data context for the control and its children. All value and command bindings are evaluated in context of this value. |
attribute
bindable
|
null | |
DataSource | Object | Gets or sets the source collection or a GridViewDataSet that contains data in the control. |
attribute
bindable
|
null | |
EmptyItemText | String | Text displayed when no value is selected. |
attribute
static value
bindable
|
||
Enabled | Boolean | Gets or sets a value indicating whether the control is enabled and can be modified. |
attribute
static value
bindable
|
False | |
FormControlStyle | BootstrapFormStyle | Gets or sets the Bootstrap form style of the control. |
attribute
static value
|
Default | |
ID | String | Gets or sets the unique control ID. |
attribute
static value
bindable
|
null | |
IncludeInPage | Boolean | Gets or sets whether the control is included in the DOM of the page. |
attribute
bindable
|
True | |
InnerText | String | Gets or sets the inner text of the HTML element. |
attribute
static value
bindable
|
null | |
ItemTextBinding | IValueBinding | The expression of DataSource item that will be displayed in the control. |
attribute
static value
bindable
|
null | |
ItemTitleBinding | IValueBinding | The expression of DataSource item that will be placed into html title attribute. |
attribute
static value
bindable
|
null | |
ItemValueBinding | IValueBinding | The expression of DataSource item that will be passed to the SelectedValue property when the item is selected. |
attribute
static value
bindable
|
null | |
SelectedValue | Object | Gets or sets the value of the selected item. |
attribute
bindable
|
null | |
Size | Size | Gets or sets the size of the ComboBox. |
attribute
static value
bindable
|
Default | |
Visible | Boolean | Gets or sets whether the control is visible. |
attribute
bindable
|
True |
Events
Name | Type | Description | |
---|---|---|---|
SelectionChanged | Command | Gets or sets the command that will be triggered when the selection is changed. |