ChoiceEdit

The ChoiceEdit component renders a Dataverse choice (option set/picklist) column as a dropdown or radio button group for single-value selection.

React Blazor

Editor Type

Set EditorType to choose between ChoiceEditType.Dropdown (default) or ChoiceEditType.RadioButtons. When using radio buttons, use RadioButtonOrientation to control vertical or horizontal layout.

React Blazor

Sort Order

Set SortOrder to control how the options are ordered. Options include Default (Dataverse order), DisplayName, DisplayNameDescending, Value, and ValueDescending.

React Blazor

Example

A basic ChoiceEdit bound to a choice column.

React example Blazor example React TypeScript Razor
(Select a value)RedBlueOrangePurpleYellowBlackWhiteBrownGreen

Configuration Options

Use the controls below to explore the available properties.

React example Blazor example React TypeScript Razor
DefaultDisplay NameDisplay Name DescendingValueValue Descending DisableRemove Default (Auto)ShowHide DropdownRadio Buttons
(Select a value)RedBlueOrangePurpleYellowBlackWhiteBrownGreen
React Blazor

ChoiceEdit Class

Parameters

Name
Type
Default
Description
ChildContentRenderFragment?
Child content of the component
ColumnName*string
Column logical name to bind the editor to from the table record.
Descriptionstring?
Description to be displayed in the tooltip.
Disabledbool?
Should the editor be disabled.
DisplayChoiceColorsbool
False
When true, a small swatch of the colour each option is given in Dataverse is shown beside it, and beside the selected value of a closed dropdown. Options with no colour get an empty space, so the labels still line up. Defaults to false.
DisplayLabelWhenAvailablebool
True
Specifies whether to display a lable if available.
DisplayNullChoicebool?
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.
DisplayTooltipWhenAvailablebool
True
Specifies whether to display a tooltip if available.
DisplayValidationErrorMessagebool
True
Should a validation error message be displayed when the component fails validation?
EditorTypeChoiceEditType
Dropdown
Type of editor to render
InvalidChoiceValuesIEnumerable<int>?
Optionally specify what values are invalid.
InvalidValueBehaviorChoiceInvalidValueBehavior
Remove
Determines the behavior of invalid values. Only applicable when either the BaseChoiceEditCommon.ValidChoiceValues or BaseChoiceEditCommon.InvalidChoiceValues parameter is supplied.
IsVisiblebool
True
Is the editor visible.
Labelstring?
Text to be displayed as a label for the editor.
RadioButtonOrientationComponentOrientation
Vertical
Orientation of the radio buttons. Only valid when the BaseChoiceEdit.EditorType is set to ChoiceEditType.RadioButtons.
ReadOnlybool?
Should the editor be read-only.
Requiredbool?
Should the value be required.
SortChoiceValueSort
Default
Determines how the values are sorted.
ValidChoiceValuesIEnumerable<int>?
Optionally specify what values are valid.
Valueint?
Value of the column.
WrapRadioButtonsbool
True
When true (the default), horizontal radio buttons that run out of room wrap onto the next row; when false, they stay on one row, which scrolls. Has no effect on vertical ones.
Name: ChildContent
Type: RenderFragment?
Description: Child content of the component
Name: ColumnName*
Type: string
Description: Column logical name to bind the editor to from the table record.
Name: Description
Type: string?
Description: Description to be displayed in the tooltip.
Name: Disabled
Type: bool?
Description: Should the editor be disabled.
Name: DisplayChoiceColors
Type: bool
Default: False
Description: When true, a small swatch of the colour each option is given in Dataverse is shown beside it, and beside the selected value of a closed dropdown. Options with no colour get an empty space, so the labels still line up. Defaults to false.
Name: DisplayLabelWhenAvailable
Type: bool
Default: True
Description: Specifies whether to display a lable if available.
Name: DisplayNullChoice
Type: bool?
Description: 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.
Name: DisplayTooltipWhenAvailable
Type: bool
Default: True
Description: Specifies whether to display a tooltip if available.
Name: DisplayValidationErrorMessage
Type: bool
Default: True
Description: Should a validation error message be displayed when the component fails validation?
Name: EditorType
Type: ChoiceEditType
Default: Dropdown
Description: Type of editor to render
Name: InvalidChoiceValues
Type: IEnumerable<int>?
Description: Optionally specify what values are invalid.
Name: InvalidValueBehavior
Type: ChoiceInvalidValueBehavior
Default: Remove
Description: Determines the behavior of invalid values. Only applicable when either the BaseChoiceEditCommon.ValidChoiceValues or BaseChoiceEditCommon.InvalidChoiceValues parameter is supplied.
Name: IsVisible
Type: bool
Default: True
Description: Is the editor visible.
Name: Label
Type: string?
Description: Text to be displayed as a label for the editor.
Name: RadioButtonOrientation
Type: ComponentOrientation
Default: Vertical
Description: Orientation of the radio buttons. Only valid when the BaseChoiceEdit.EditorType is set to ChoiceEditType.RadioButtons.
Name: ReadOnly
Type: bool?
Description: Should the editor be read-only.
Name: Required
Type: bool?
Description: Should the value be required.
Name: Sort
Type: ChoiceValueSort
Default: Default
Description: Determines how the values are sorted.
Name: ValidChoiceValues
Type: IEnumerable<int>?
Description: Optionally specify what values are valid.
Name: Value
Type: int?
Description: Value of the column.
Name: WrapRadioButtons
Type: bool
Default: True
Description: When true (the default), horizontal radio buttons that run out of room wrap onto the next row; when false, they stay on one row, which scrolls. Has no effect on vertical ones.

Events

Name
Type
Description
ValueChangedEventCallback<ColumnValueBase>
Gets or sets a callback that updates the bound value.
Name: ValueChanged
Type: EventCallback<ColumnValueBase>
Description: Gets or sets a callback that updates the bound value.

Methods

Name
Parameters
Type
Description
GetValidationErrorsList<string>
Returns a collection of the current validation errors.
Name: GetValidationErrors
Type: List<string>
Description: Returns a collection of the current validation errors.