ChoiceEdit

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" />

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.

<!-- Dropdown (default) -->
<ChoiceEdit ColumnName="ppp_favoritecolor" EditorType="ChoiceEditType.Dropdown" />

<!-- Radio buttons -->
<ChoiceEdit ColumnName="ppp_favoritecolor"
            EditorType="ChoiceEditType.RadioButtons"
            RadioButtonOrientation="ComponentOrientation.Horizontal" />

Sort Order

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

<ChoiceEdit ColumnName="ppp_favoritecolor" SortOrder="ChoiceSortOrder.DisplayName" />

ChoiceEdit

Here is an example that demonstrates the use of a ChoiceEdit component.

Example
RedBlueOrangePurpleYellowBlackWhiteBrownGreen

ChoiceEdit (Extended Properties)

This demonstrates the most common the properties that are availabe to set on the ChoiceEdit.

Example
Readonly? Required? Disabled? DefaultDisplay NameDisplay Name DescendingValueValue Descending DisableRemove DropdownRadio Buttons
RedBlueOrangePurpleYellowBlackWhiteBrownGreen

ChoiceEdit Class

Parameters

Name
Type
Default
Description
ChildContentRenderFragment?
Child content of the component
ColumnNamestring
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.
DisplayLabelWhenAvailablebool
True
Specifies whether to display a lable if available.
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 or 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 is set to .
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.
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: DisplayLabelWhenAvailable
Type: bool
Default: True
Description: Specifies whether to display a lable if available.
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 or 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 is set to .
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.

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.