Associating a DataWindow object with the control

After placing the control, you associate a DataWindow object with the control.

First you need to add the PBL that contains the DataWindow object to the solution.

StepsTo associate a DataWindow object with the control:

  1. In the Solution Explorer, right-click the name of the application and select Add>Add Existing Item.

  2. In the Add Existing Item dialog box, select All Files in the Files of Type drop-down list, browse to the location of start.pbl and select it, then click Add.

  3. Right-click the WebDataWindowControl on the form and select Properties.

  4. In the Properties window, locate the LibraryList property in the left panel, and click the Browse (...) button in the right panel to open the Specify Library List dialog box.

  5. Click the Add Library to Library List icon and click the browse button.

  6. In the Select Library dialog box, select start.pbl in the Contents pane and click OK.

    The Contents of folder pane on the right lists the start pibble.

    You can add multiple libraries to the list. When you specify a DataWindow object, the server searches the libraries for it in the order in which the libraries display in the list.

  7. Click OK to close the Specify Library List dialog box.

  8. Select DataWindowObject in the Properties window, click the browse button in the right pane to open the Select DataWindow dialog box, select the d_custlist DataWindow object, and click OK.

    The column headers display in the control on the form.

  9. Change the (ID) property of the control to dwCustList.

  10. Set the AutoSaveDataCacheAfterRetrieve and AutoRestoreDataCache properties to true.

    The data will be saved to a cache after a retrieve and the data cache will be restored after a postback.

  11. Set the Height property to 240 and make sure that the VerticalScrollBar property is set to Auto.

    The Customers table in the database has more than 100 rows. By default, all of the rows display. Setting the Height property restricts the number of rows that display. Setting the VerticalScrollBar property to Auto adds a scroll bar if one is needed.