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.
ChoiceEdit (Extended Properties)
This demonstrates the most common the properties that are availabe to set on the ChoiceEdit.
ChoiceEdit Class
Parameters
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. |
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 or 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 is set to . |
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. |
Name:
ChildContentType:
RenderFragment?
Description:
Child content of the component
Name:
ColumnNameType:
string
Description:
Column logical name to bind the editor to from the table record.
Name:
DescriptionType:
string?
Description:
Description to be displayed in the tooltip.
Name:
DisabledType:
bool?
Description:
Should the editor be disabled.
Name:
DisplayLabelWhenAvailableType:
bool
Default:
True
Description:
Specifies whether to display a lable if available.
Name:
DisplayTooltipWhenAvailableType:
bool
Default:
True
Description:
Specifies whether to display a tooltip if available.
Name:
DisplayValidationErrorMessageType:
bool
Default:
True
Description:
Should a validation error message be displayed when the component fails validation?
Name:
EditorTypeType:
ChoiceEditType
Default:
Dropdown
Description:
Type of editor to render
Name:
InvalidChoiceValuesType:
IEnumerable<int>?
Description:
Optionally specify what values are invalid.
Name:
InvalidValueBehaviorType:
ChoiceInvalidValueBehavior
Default:
Remove
Description:
Determines the behavior of invalid values. Only applicable when either the or parameter is supplied.
Name:
IsVisibleType:
bool
Default:
True
Description:
Is the editor visible.
Name:
LabelType:
string?
Description:
Text to be displayed as a label for the editor.
Name:
RadioButtonOrientationType:
ComponentOrientation
Default:
Vertical
Description:
Orientation of the radio buttons. Only valid when the is set to .
Name:
ReadOnlyType:
bool?
Description:
Should the editor be read-only.
Name:
RequiredType:
bool?
Description:
Should the value be required.
Name:
SortType:
ChoiceValueSort
Default:
Default
Description:
Determines how the values are sorted.
Name:
ValidChoiceValuesType:
IEnumerable<int>?
Description:
Optionally specify what values are valid.
Name:
ValueType:
int?
Description:
Value of the column.
Events
Name | Type | Description |
|---|---|---|
ValueChanged | EventCallback<ColumnValueBase> | Gets or sets a callback that updates the bound value. |
Name:
ValueChangedType:
EventCallback<ColumnValueBase>
Description:
Gets or sets a callback that updates the bound value.
Methods
Name | Parameters | Type | Description |
|---|---|---|---|
GetValidationErrors | List<string> | Returns a collection of the current validation errors. |
Name:
GetValidationErrorsType:
List<string>
Description:
Returns a collection of the current validation errors.
