Try OpenEdge Now
skip to main content
GUI for .NET Programming
Binding ABL Data to .NET Controls : Example of an updatable grid
 

Example of an updatable grid

When run, UpdatableDataBindingGrid.p creates a Infragistics.Win.UltraWinGrid.UltraGrid that displays hierarchical data from a ProDataSet on the Customer, Order, and Orderline tables, as shown in the following figure.
Figure 16. Updatable grid
The application's event logic can handle adding, deleting, and editing records. For information on using the sample applications for this manual, see Example procedures.
To test the event logic:
1. Run UpdatableDataBindingGrid.p with the Sports2000 database attached.
2. Select CustNum 6 and expand the child grids to display an order and its orderlines.
3. Select the gray row at the bottom of the Orderlines grid. The default values for the fields are filled in automatically, as shown:
Obviously, in a business application, the event logic would perform some additional steps, such as incrementing the Line Num field.
4. Enter data for the new orderline and select another row in the grid. The procedure stores the new record, adds a new row to the child query, and refreshes the grid to display the new orderline:
5. Add several more orderlines:
6. Select your orderlines and press DELETE. A dialog appears to confirm the deletion:
7. Click Yes and a message box like the following appears confirming the deletion of each orderline:
The sections that follow examine the inner workings of this procedure.
* Definitions
* Main block
* Internal procedures and functions