Back to Devexpress

Implement Dependent Reference Properties

expressappframework-402979-getting-started-in-depth-tutorial-blazor-define-data-model-and-set-initial-data-define-data-model-and-set-initial-data-with-ef-core-implement-dependent-reference-properties-ef-core.md

latest2.2 KB
Original Source

Implement Dependent Reference Properties

  • May 07, 2025
  • 3 minutes to read

This lesson explains how to implement properties whose values depend on other properties.

For this purpose, add a new Manager property to the Employee class. The editor for this property displays a list of managers who work in the same department.

Note

Before you proceed, take a moment to review the previous lessons:

Step-by-Step Instructions

  1. Add the new Manager property to the Employee class:

  2. Apply the DataSourceProperty and DataSourceCriteria attributes to the newly added property:

  3. Run the application and make the following changes:

  4. Create a new Employee object. In the Employee Detail View, specify the Department property and expand the Manager lookup editor. Notice that it only shows the managers from the specified department.

Tip

You can use integrated XAF designers to implement the same behavior without code. For details, refer to the following article: How to: Implement Cascading Filtering for Lookup List Views.

Next Lesson

Create a Calculated Property

See Also

Criteria Language Syntax

Data Filtering