By completing the procedure in the previous section, you created an object, bindingSource1, that is now available as a data source for any of the controls in the Toolbox that can display or manipulate data. In this section, you will implement one such control, the UltraGrid, and bind it to bindingSource1. In addition, you will set some properties for the form and the control.
Note: The UltraGrid is similar, in some ways, to the OpenEdge browse widget. The key advantage of the UltraGrid is that it can manage and display multiple parent-child levels of data, such as the ecustomer and esalesrep tables you defined for bindingSource1.
To connect an UltraGrid to bindingSource1:
1. With customerForm.cls open in the Visual Designer canvas, expand the OpenEdge Ultra Controls control group in the Toolbox.
2. Drag and drop the UltraGrid control from the Toolbox to the Customer form.
For many of the controls, the default behavior after a drag and drop is to display a wizard that walks you through the process of setting the properties of the control. When you drop the UltraGrid control, the UltraWinGrid Quick Start wizard appears.
3. On the Data Schema page of the UltraWinGrid Quick Start wizard, select Bind the control to an existing DataSource now from the drop-down menu as shown in the following illustration:
4. Select DataSource, and then select bindingSource1 from the drop-down menu as shown in the following illustration:
After you select bindingSource1, a preview of its schema looks similar to the following:
5. Click Finish. For the Customer form, it is not necessary to change anything else.
There are many more customizations that you can perform if you continue with the wizard. However, if you are familiar with the properties of a control, it is usually quicker to make changes by editing property values directly in the Properties view.
At this point you can align the UltraGrid control with respect to the borders of the form.