Exercise - Creating a Simple Screen

  1. First we will add Northwind to Git.
  2. Click on the bottom right coroner of Visual Studio option Add to Source Control.

Add to source Control

  1. Click and select the option to add to Git.

Git

  1. After a bit of time the status bar will update and Team Explorer panel will open

Status bar

  1. Now your code is in local Git.
  2. Change back to the Solution Explorer panel.

Solution Explorer

  1. Right click on the Northwind project, select Add then select New Folder, name the new folder “Exercises”.
  2. Right click “Exercises” and select Add then select New Item, an Add new Item screen will open.
  3. Select from the list to the left Templates, and from the list in the center of the screen select UIController
  4. In the Name box at the bottom of the screen type in the name ShowProducts.
  5. Define the Products table at the beginning of the controller class.(drag and drop it, holding the Shift key just before the drop).
  6. In the constructor use the From to set the Products to be the class main table.
  7. Build the Northwind Project. (in the Build pulldown menu, select Build Northwind).
  8. Go to the OnLoad method find the call to the view use the F12 key to navigate to the Form Designer:
  9. Setup the Toolbox if you did not do that early, by right clicking on the form, select "Setup Toolbox".
  10. Add a grid with the following columns:
    1. ProductID
    2. ProductName
    3. CategoryID
    4. UnitPrice
    5. UnitsInStock
    6. UnitsOnOrder
  11. Expand the form width to show the entire grid.
  12. Add a new menu entry to call this screen.
  13. Save the changes to Git by clicking on the pencil icon in the status bar.

Save To Git

  1. Build and test.

Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com