To continue with this content, please log in with your Data Access ID or create a new account.
Cancel Data Access ID
You may not be authorized to see this content. Please contact Data Access Europe for more information.
Cancel Data Access Europe
You are not authorized to see this content.
Cancel Data Access Europe
Next lesson:
Manipulating data
Cancel

Working with databases

Lesson 8: Grids

Building on the view that was created in the last lesson to view and edit existing recipes this lesson will now add the list of ingredients to the view using grids.

From the design view of Recipe.vs [Design] in the DataFlex Studio.

  1. Select to view the DDO Explorer in the right panel.
  2. Select the ‘Add DDO’ icon from the top of the panel.
  3. Select ‘cIngredientsDataDictionary’ form the list. Select ‘Select.’
  4. Select, drag and drop ‘cDbCJGrid’ from the ‘Class Palette’ on the left onto the view.
  5. This grid is a database aware Codejock grid
  6. Resize the grid as needed.
  7. Expand ‘cIngredientsDataDictionary [Constrained to cRecipe]’ in the DDO Explorer.
  8. Check ‘Name’ and ‘Amount’
  9. Click on ‘Name,’ and drag it into the grid.
  10. Columns for both will be added to the grid.
  11. Click on the bottom ‘Properties’ tab of the ‘Properties’ panel on the right, and then select the ‘Binding’ tab from the middle section.
  12. Note that the ‘Data Server’ has automatically been set to ‘oIndredients_DD.’
  13. The source code also shows the same.
  14. Change the column titles in the code from “Name” to “Ingredients.”
    Set psCaption to “Ingredients”

  15. Select the ‘Run’ icon from the top toolbar to launch the application.
  16. Select ‘View’ from the application’s top toolbar and select ‘Recipe.’ 
  17. The grid is now in place showing the list of ingredients and corresponding amounts.
  18. To further demonstrate the use of the grid a new record will be added through the application…
  19. Select ‘Clear/Add’ from the top menu to clear the buffer.
  20. Add recipe details to the various details.