The ChoiceEdit component renders a Dataverse choice (option set/picklist) column as a dropdown or radio button group for single-value selection.
<ChoiceEdit columnName="ppp_favoritecolor" /><ChoiceEdit ColumnName="ppp_favoritecolor" />Set EditorType to choose between ChoiceEditType.Dropdown (default) or ChoiceEditType.RadioButtons. When using radio buttons, use RadioButtonOrientation to control vertical or horizontal layout.
{/* Dropdown (default) */}
<ChoiceEdit columnName="ppp_favoritecolor" editorType={ChoiceEditorType.Dropdown} />
{/* Radio buttons */}
<ChoiceEdit
columnName="ppp_favoritecolor"
editorType={ChoiceEditorType.RadioButtons}
radioButtonOrientation={ChoiceOrientation.Horizontal}
/><!-- Dropdown (default) -->
<ChoiceEdit ColumnName="ppp_favoritecolor" EditorType="ChoiceEditType.Dropdown" />
<!-- Radio buttons -->
<ChoiceEdit ColumnName="ppp_favoritecolor"
EditorType="ChoiceEditType.RadioButtons"
RadioButtonOrientation="ComponentOrientation.Horizontal" />Set SortOrder to control how the options are ordered. Options include Default (Dataverse order), DisplayName, DisplayNameDescending, Value, and ValueDescending.
<ChoiceEdit columnName="ppp_favoritecolor" sort={ChoiceValueSort.DisplayName} /><ChoiceEdit ColumnName="ppp_favoritecolor" SortOrder="ChoiceSortOrder.DisplayName" />A basic ChoiceEdit bound to a choice column.
Use the controls below to explore the available properties.
Name | Type | Default | Description |
|---|---|---|---|
ChildContent | RenderFragment? | Child content of the component | |
ColumnName* | string | Column logical name to bind the editor to from the table record. | |
Description | string? | Description to be displayed in the tooltip. | |
Disabled | bool? | Should the editor be disabled. | |
DisplayLabelWhenAvailable | bool | True | Specifies whether to display a lable if available. |
DisplayNullChoice | bool? | Whether to show a '(none)' choice that clears the column back to null. When omitted, the default is required-aware: a required column hides it (the user must pick a real value); a non-required column shows it. Set explicitly to override either default. | |
DisplayTooltipWhenAvailable | bool | True | Specifies whether to display a tooltip if available. |
DisplayValidationErrorMessage | bool | True | Should a validation error message be displayed when the component fails validation? |
EditorType | ChoiceEditType | Dropdown | Type of editor to render |
InvalidChoiceValues | IEnumerable<int>? | Optionally specify what values are invalid. | |
InvalidValueBehavior | ChoiceInvalidValueBehavior | Remove | Determines the behavior of invalid values. Only applicable when either the BaseChoiceEditCommon.ValidChoiceValues or BaseChoiceEditCommon.InvalidChoiceValues parameter is supplied. |
IsVisible | bool | True | Is the editor visible. |
Label | string? | Text to be displayed as a label for the editor. | |
RadioButtonOrientation | ComponentOrientation | Vertical | Orientation of the radio buttons. Only valid when the BaseChoiceEdit.EditorType is set to ChoiceEditType.RadioButtons. |
ReadOnly | bool? | Should the editor be read-only. | |
Required | bool? | Should the value be required. | |
Sort | ChoiceValueSort | Default | Determines how the values are sorted. |
ValidChoiceValues | IEnumerable<int>? | Optionally specify what values are valid. | |
Value | int? | Value of the column. |
ChildContentColumnName*DescriptionDisabledDisplayLabelWhenAvailableDisplayNullChoiceDisplayTooltipWhenAvailableDisplayValidationErrorMessageEditorTypeInvalidChoiceValuesInvalidValueBehaviorBaseChoiceEditCommon.ValidChoiceValues or BaseChoiceEditCommon.InvalidChoiceValues parameter is supplied.IsVisibleLabelRadioButtonOrientationBaseChoiceEdit.EditorType is set to ChoiceEditType.RadioButtons.ReadOnlyRequiredSortValidChoiceValuesValueName | Type | Description |
|---|---|---|
ValueChanged | EventCallback<ColumnValueBase> | Gets or sets a callback that updates the bound value. |
ValueChangedName | Parameters | Type | Description |
|---|---|---|---|
GetValidationErrors | List<string> | Returns a collection of the current validation errors. |
GetValidationErrors