This section describes how to add and configure an UltraTree control. You bind the UltraTree control to the ProBindingSource control and then use the UltraTree ColumnSet Layout Designer to define what data is displayed.
To add and configure an UltraTree control:
1. Find UltraTree in the OpenEdge Ultra Controls control group in the OpenEdge Toolbox.
2. Drag UltraTree to the Departments form on the Design Canvas.
3. Select the UltraTree control on the Design Canvas, click the Dock property in the Properties view and choose the middle option, Fill, from the drop-down. The control binds to the four borders of the Departments form.
4. Click the Smart Tag arrow on the UltraTree control on the Design Canvas, to open the Smart Tag pop-up panel.
Smart Tags offer a list of the most frequently used properties for the control. If Smart Tags are available, the control has a small right-arrow button at the top right corner when it is selected,as shown in the following illustration:
5. In the Smart Tag panel, set DataSource to bindingSource1 as shown in the following illustration:
The following figure shows the UltraTree, after data binding, with all the nodes expanded.
Figure 11. The UltraTree bound to a ProBindingSource
Notice that all the fields in all three tables (edepartment, eemployee, and efamily) are represented. This reflects the schema imported into the ProBindingSource. In a real world application, you might want to hide some of the data. You can eliminate unwanted fields directly in the ProBindingSource control by removing them with the ProBindingSource Designer.
However, you might want the ProBindingSource to include all the data, so it can be bound to a number of controls. For example, one control can implement a browse that supplies names, addresses, and phone numbers and suppresses all other information. Another control, bound to the same ProBindingSource, can implement a browse that displays only employee names, vacation days, and sick days. The ColumnSet Layout Designer of the UltraTree control allows you to specify which fields to show and which fields to hide.