ComboBoxFormGroup
in namespace DotVVM.Framework.Controls.Bootstrap4
Renders a FormGroup control with a ComboBox
Usage & Scenarios
Sample 1: Form Group properties
ComboBoxFormGroup is just wrapper around ComboBox inside FormGroup, so you can use any of the properties of the FormGroup and ComboBox to configure desired behaviour.
For example you can use the Label
property to set the Label of the FormGroup.
<bs:Form>
<bs:ComboBoxFormGroup DataSource="{value: Fruits}" SelectedValue="{value: SelectedFruit}" LabelText="Fruits" />
</bs:Form>
using DotVVM.Framework.ViewModel;
namespace DotvvmWeb.Views.Docs.Controls.bootstrap4.ComboBoxFormGroup.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 | |
ContentTemplate | List<DotvvmControl> | Gets or sets the content of the form group. |
inner element
static value
bindable
default
|
null | |
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 | |
LabelSize | Int32? | Gets or sets the size of size the label area for all screen sizes. This applies only to the Horizontal forms. |
attribute
static value
|
null | |
LabelSizeLG | Int32? | Gets or sets the size of the label area large screen. This applies only to the Horizontal forms. |
attribute
static value
|
null | |
LabelSizeMD | Int32? | Gets or sets the size of the label area for medium screen. This applies only to the Horizontal forms. |
attribute
static value
|
null | |
LabelSizeSM | Int32? | Gets or sets the size of the label area small screen. This applies only to the Horizontal forms. |
attribute
static value
|
null | |
LabelSizeXL | Int32? | Gets or sets the size of the label area for extra large screen. This applies only to the Horizontal forms. |
attribute
static value
|
null | |
LabelTemplate | ITemplate | Gets or sets the template of the label area. This property cannot be combined with the LabelText property. |
inner element
static value
|
null | |
LabelText | String | Gets or sets the label text. This property cannot be combined with the LabelTemplate property. |
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 controls in the form group. |
attribute
static value
bindable
|
Default | |
Type | FormGroupType | Gets or sets the type of the form. |
attribute
static value
|
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. |