Step 10. Running the Data Bound Window

In this step you will run the data bound window and learn how user interface controls and business objects collaborate in retrieving, displaying, manipulating, and saving data.

  1. Go back to Visual Studio and click the Start button in the Toolbar to run the application. From the menu, select Activities | Customer Orders to launch the Customer Orders window.

    Notice that the only button that is enabled is the window's Close button. All other buttons have been disabled manually, or disabled automatically by the business object controllers they are registered with.

  2. In the Auto-Complete Text Box, enter the letter "Q". This displays a pop-up of all customers that start with the letter Q:

    Behind the scenes, when you type a character in the Auto-Complete Text Box, its SearchStringChanged event fires and the handler method calls the Customer business object's GetCustomersLikeCustomerID() method and the results are displayed in the popup list.

  3. Select one of the Customer IDs from the popup list. This displays the orders for the selected Customer:

    Behind the scenes, when you select a Customer from the popup list, the Auto-Complete Text Box's SearchStringSelected event fires and the handler method calls the Order business object's GetOrdersByCustomerID() method and the Orders are displayed in the DataGrid.

  4. Click on the Properties tab to see the detail for this order. All text boxes and combo boxes display the values for the currently selected orders and the Order Detail DataGrid displays the item detail for the current order:

  5. Click on the List tab and select a different order in the DataGrid. Then click back on the Properties tab to see the detail for the selected order. You should see the values for the currently selected order in the text boxes and combo boxes as well as the item detail for the newly selected order:

    Behind the scenes, the text boxes and combo boxes automatically synchronize to the newly selected order because these controls are bound to the same Data Context as the Orders DataGrid on the List page.

    When you select a different Order in the DataGrid, its SelectionChanged event fires and the code in the handler method for this event gets the Order ID of the currently selected Order and passes it to the OrderDetail business controller's GetOrderDetail() method and the results are displayed in the Order Detail DataGrid.

    See Also:
    Step 11. Setting up Window Navigation


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 03/16/10
Comment or report problem with topic