TabDropDown
in namespace DotVVM.Bootstrap5.Controls
Renders a dropdown button that can be used inside the TabControl.
Usage & Scenarios
A special version of the DropDown control that can be used in TabControl.
See DropDown for more info on how to use this control.
Sample 1: TabDropDown Control
The <bs:TabDropDown>
control has limited features for drop down toggle button in comparison with a standard DropDown control. Nevertheless, both DropDown and <bs:TabDropDown>
share the same child control DropDownItem
.
<bs:TabControl HorizontalAlingment="Center"
Justify="fill">
<bs:TabDropDown HeaderText="Header">
<bs:DropDownItem>item</bs:DropDownItem>
<bs:DropDownSeparator />
<bs:DropDownItem>item</bs:DropDownItem>
<bs:DropDownItem>item</bs:DropDownItem>
</bs:TabDropDown>
<bs:TabItem>
<HeaderTemplate> Tab 1 </HeaderTemplate>
My tab 1
</bs:TabItem>
<bs:TabItem>
<HeaderTemplate> Tab 2 </HeaderTemplate>
tab 2
</bs:TabItem>
</bs:TabControl>
Properties
Name | Type | Description | Notes | Default Value | |
---|---|---|---|---|---|
ClientIDMode | ClientIDMode | Gets or sets the client ID generation algorithm. |
attribute
static value
|
Static | |
CloseBehavior | DropDownCloseBehavior | Gets or sets the dropdown closing behavior. Possible values are `Default`, `Inside`, `Outside` and `Manual`. |
attribute
static value
|
Default | |
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. The DataContext is null in client-side templates. |
attribute
bindable
|
null | |
DataSource | IValueBinding<IEnumerable<Object>> | Gets or sets the data source for the items in the dropdown menu. |
attribute
bindable
|
null | |
DropDirection | DropDirection | Gets or sets the direction in which the dropdown menu should open. |
attribute
static value
|
DropDown | |
Enabled | Boolean | Gets or sets whether the toggle button is enabled or disabled. |
attribute
static value
bindable
|
True | |
HeaderTemplate | ITemplate | Gets or sets a custom template for the dropdown button. |
inner element
static value
|
null | |
HeaderText | String | Gets or sets a plain text for the dropdown button. |
attribute
static value
bindable
|
null | |
ID | String | Gets or sets the control client ID within its naming container. |
attribute
static value
bindable
|
null | |
IncludeInPage | Boolean | Gets or sets whether the control is included in the DOM of the page. |
attribute
bindable
|
True | |
IsCollapsed | IValueBinding<Boolean> | Gets or sets whether the dropdown menu is collapsed or expanded. |
attribute
bindable
|
null | |
ItemEnabled | Boolean | Gets or sets whether the individual items in the dropdown menu should be enabled or disabled when DataSource is set. |
attribute
static value
bindable
|
True | |
ItemNavigateUrl | String | Gets or sets the URL to navigate to when an item in the dropdown menu is clicked when DataSource is set. |
attribute
static value
bindable
|
null | |
ItemRouteName | String | Gets or sets the route name to navigate to when an item in the dropdown menu is clicked when DataSource is set. |
attribute
static value
|
null | |
Items | List<IDropDownItem> | Gets or sets the items inside the control. |
inner element
static value
default
|
null | |
ItemSelected | Boolean | Gets or sets whether an individual item in the dropdown menu is selected when DataSource is set. |
attribute
static value
bindable
|
null | |
ItemTemplate | ITemplate | Gets or sets the template to use for rendering each item in the dropdown menu when DataSource is set. |
inner element
static value
|
null | |
ItemText | String | Gets or sets the text to display for each item in the dropdown menu when DataSource is set. |
attribute
static value
bindable
|
null | |
ItemUrlSuffix | String | Gets or sets a suffix to append to the URL of each item in the dropdown menu when DataSource is set. |
attribute
static value
bindable
|
null | |
Visible | Boolean | Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control. |
attribute
static value
bindable
|
True |
Events
Name | Type | Description | |
---|---|---|---|
ItemClick | ICommandBinding | Gets or sets the command that will be triggered when individual items in the dropdown menu are clicked and DataSource is set. |