Exercise - Columns Recompute
- In ShowProducts.
- Add a new local Column, Type NumberColumn, Name TotalValueInStock.
- Build.
- Using the Class Outline go to the form.
- Use the Grid, Column Wizard and add the new column to the grid.
- Go back to the ShowProducts controller.
- Add this columns to the column collection:
- Products.ProductID.
- Products.ProductName.
- Products.CategoryID.
- Products.UnitPrice.
- Products.UnitsInStock.
- Products.UnitsOnOrder.
- Categories.CategoryID.
- Categories.CategoryName.
- TotalValueInStock.
- Use BindValue to set the value of TotalValueInStock to show UnitPrice * UnitsInStock.
- Save changes to Git.
- Build and test. (Change the number of Units In Stock and the check that TotalValueInStock is change).
- Break into the code using the Shift F12.
- Add TotalValueInStock.__RecomputePath the Watch panel.
- Expand the result and notice the result.
- Stop the program.
- Use Alt arrow up to change the Columns.Add of TotalValueInStock location to be the first one.
- Save changes to Git.
- Build and test. (Change the number of Units In Stock and the check that TotalValueInStock is not changing)
- Break into the code using the Shift F12.
- Check the TotalValueInStock.__RecomputePath.
- Stop the program.
- Use Alt arrow down to change the Columns.Add of TotalValueInStock location to be the last one.
- Save changes to Git.
- build and test.
Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com