What Changed
We have made the following changes in the DxComboBox, DxListBox, and DxTagBox classes's API:
-
The DxComboBox, DxListBox, and DxTagBox now require specifying two generic type parameters:
TData
- The data item type.TValue
- The value type.
-
The following properties have been renamed:
DxComboBox.SelectedItem
->DxComboBox.Value
DxComboBox.SelectedItemExpression
->DxComboBox.ValueExpression
DxListBox.SelectedItems
->DxListBox.Values
DxListBox.SelectedItemExpression
->DxListBox.ValuesExpression
DxTagBox.SelectedItems
->DxTagBox.Values
DxTagBox.SelectedItemsExpression
->DxTagBox.ValuesExpression
-
The TagBoxValidateBy enumeration's values have been changed:
- The default validation mode is changed (now it is
Auto
) TagBoxValidateBy.SelectedItems
->TagBoxValidateBy.Values
- The default validation mode is changed (now it is
Reasons for Change
Now, you can bind ComboBox, List Box, and TagBox not only to the entire data source object, but also to a specific field of this object. To do this, use the component's ValueFieldName
property:
Razor<DxComboBox Data="@Persons.DataSource"
ValueFieldName="@nameof(Person.Id)"
@bind-Value="@Value">
</DxComboBox>
The changes described in this breaking change were made to implement this functionality in our components.
Impact on Existing Apps
The changes affect your application if you use any of the mentioned components (ComboBox, List Box, or TagBox) in the application code:
Razor<DxComboBox Data="@Cities"
@bind-SelectedItem="@SelectedItem">
</DxComboBox>
<DxListBox Data="@Persons.DataSource"
@bind-SelectedItems="@SelectedItems">
</DxListBox>
<DxTagBox Data="@Persons.DataSource"
@bind-SelectedItems="@SelectedPersons">
</DxTagBox>
How to Update Existing Apps
In the scenario above, update the application code as follows:
Razor<DxComboBox Data="@Cities"
@bind-Value="@SelectedItem">
</DxComboBox>
<DxListBox Data="@Persons.DataSource"
@bind-Values="@SelectedItems">
</DxListBox>
<DxTagBox Data="@Persons.DataSource"
@bind-Values="@SelectedPersons">
</DxTagBox>