Breaking Change T921360
Visible to All Users

The ComboBox, List Box, and TagBox components' API and declaration have been changed

What Changed

We have made the following changes in the DxComboBox, DxListBox, and DxTagBox classes's API:

  1. The DxComboBox, DxListBox, and DxTagBox now require specifying two generic type parameters:

    • TData - The data item type.
    • TValue - The value type.
  2. 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
  3. The TagBoxValidateBy enumeration's values have been changed:

    • The default validation mode is changed (now it is Auto)
    • TagBoxValidateBy.SelectedItems -> TagBoxValidateBy.Values

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>

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.