The form's tree
controls are a user-friendly way of displaying a hierarchy of related records, such as a company's organizational structure, inventory bill of materials, projects with their subprojects, and so on. These hierarchies can also be displayed in the custom lookups, allowing users to browse and select the required value in a more convenient way.
The Using a tree control recipe in Chapter 2, Working with Forms, explained how to present the budget model hierarchy as a tree in the Budget model
form. In this recipe, we will reuse the previously created BudgetModelTree
class and demonstrate how to build a budget model tree lookup.
- In the AOT, create a new form named
BudgetModelLookup
. Set its design properties as follows:
Property | Value |
Frame | Border |
WindowType | Popup |
- Add a new
Tree
control to the design with the following properties:
Property | Value |
Name | ModelTree |
Width | 250 |
- Add the following line of code to the form's class declaration:
BudgetModelTree budgetModelTree...