ComboBox
Description
This component represents a combo box in Blazor using the Gap.Blazor.ComboBox
model. It utilizes the Telerik ComboBox
component to provide a searchable, filterable dropdown list with support for custom values and dynamic styling.
Usage
Properties
ComboBox: Instance of the
Gap.Blazor.ComboBox
model.ElementRef: Reference to the Telerik
ComboBox
component.Items: A dynamically generated list of objects with
text
andvalue
fields based onListControlItems
.Value: Bound to the selected value in the combo box.
Methods
OnInitialized(): Subscribes to model events such as
SelectedIndexChanged
,SelectedValueChanged
,ValueMemberChanged
,DataSourceChanged
,DisplayMemberChanged
,DropDownStyleChanged
, andItems.AfterAdd
.Focus(): Focuses the combo box using the
elementRef
.
Dynamic Rendering
The component dynamically renders a combo box based on the ComboBox
model:
WMStyleBase: Applies styles based on the model.
TelerikComboBox: Provides the dropdown UI with filtering and custom value support.
NoDataTemplate: Displays a message when no items are available.
Styles
Dropdown Positioning: Adjusted using
.k-animation-container
.Height and Font Size: Dynamically set based on the model.
List Item Styling: Font size is derived from the model’s font settings.
Events
SelectedIndexChanged
SelectedValueChanged
ValueMemberChanged
DataSourceChanged
DisplayMemberChanged
DropDownStyleChanged
Items.AfterAdd
Last updated