HxSelect

Select - DropDownList - single-item picker. Consider creating custom picker derived from HxSelectBase.

Examples

Selected initials:

API

Parameters

Name Type Description
AdditionalAttributes IReadOnlyDictionary<string, TValue> A collection of additional attributes that will be applied to the created element.
AutoSort bool When true, items are sorted before displaying in select. Default value is true.
ChipTemplate RenderFragment Chip template.
CssClass string Custom CSS class to render with wrapping div.
Data IEnumerable<string> Items to display.
DisplayName string
Enabled bool? When null (default), the Enabled value is received from cascading FormState. When value is false, input is rendered as disabled. To set multiple controls as disabled use HxFormState.
GenerateChip bool When true, HxChipGenerator is used to generate chip item(s). Default is true.
Hint string Hint to render after input as form-text.
HintTemplate RenderFragment Hint to render after input as form-text.
InputCssClass string Custom CSS class to render with the input element.
InputSize InputSize? Size of the input.
Label string Label to render before input (or after input for Checkbox).
LabelCssClass string Custom CSS class to render with the label.
LabelTemplate RenderFragment Label to render before input (or after input for Checkbox).
Nullable bool? Indicates whether null is a valid value.
NullDataText string Text to display when Data is null.
NullText string Text to display for null value.
Settings SelectSettings Set of settings to be applied to the component instance (overrides HxSelect.Defaults, overriden by individual parameters).
ShowValidationMessage bool When false, validation message is not rendered. Default is true.
SortKeySelector Func<string, IComparable> Selects value to sort items. Uses TextSelector property when not set. When complex sorting required, sort data manually and don't let sort them by this component. Alternatively create a custom comparable property.
TextSelector Func<string, string> Selects text to display from item. When not set ToString() is used.
Value string Value of the input. This should be used with two-way binding.
ValueChanged EventCallback<string> A callback that updates the bound value.
ValueExpression Expression<Func<string>> An expression that identifies the bound value.
ValueSelector Func<string, string> Selects value from item. Not required when TValueType is same as TItemTime.

Methods

Method Returns Description
FocusAsync() ValueTask Gives focus to the input element.
An unhandled error has occurred. Reload 🗙