Attach the DataWindow object to a DataWindow control

Note

Now you attach the DataWindow object to a DataWindow control in the w_emplist_tutorial_main window.

  1. Expand the emplist_tutorial.pkl branch in the System Tree.

    Shown is emp list underscore tutorial pibble expanded in the System Tree.
  2. Right-click w_emplist_tutorial_main and select Edit from the pop-up menu

    or

    Double-click w_emplist_tutorial_main in the System Tree.

    The Window painter displays the w_emplist_tutorial_main window.

  3. Make sure the Layout view displays.

    Select Insert>Control>DataWindow from the menu bar and click inside the main window in the Layout view.

    An empty DataWindow control displays in the window.

    Shown are the Layout and Properties views of the Window painter. An empty box appears for the Data Window control in the Layout view. The name of the Data Window control in the Properties view is d w underscore 1.
  4. In the Properties view for the DataWindow, select HScrollBar and VScrollBar.

    The scroll bars enable users to scroll through the list of employees when they run the application.

    Now you need to associate the d_sqlgr_employee DataWindow object that you created in the last exercise with the DataWindow control that you just added to the window.

  5. In the Properties view, click the browse button next to the DataObject text box and select the d_sqlgr_employee DataWindow.

  6. Click OK.

    PocketBuilder associates the d_sqlgr_employee DataWindow object with the DataWindow control.

    The Layout view now shows the d_sqlgr_employee DataWindow headings inside the DataWindow control, but you do not see any data yet. The DataWindow does not execute its SELECT statement until you run the application.

  7. Select the DataWindow control and then and drag its borders so the control takes up most of the space in the main window.

    When you are done, the window should look something like this:

    Shown is the appearance of the DataWindow control in the Layout view of the WIndow painter. The First Name and Last Name heading labels of the Data Window are visible, but the data from the data source is not visible at design time.