This sample illustrates the usage of GridFormulaEngine.NamedRanges method in a grid control. The sample allows you to enter parameters, such as retirement age and initial savings, and then computes the age at which you would run out of funds during retirement; this is based on either inflation or investment return assumptions that you enter. It will also perform a Monte Carlo-type simulation, using random adjustments to your base assumptions, to estimate the probability of running out of funds at certain intervals.
Features
This sample illustrates the use of a context menu to display named ranges.
GridMarkHeadersHelper class is used to mark row and column headers for the current cell.
An XLS spreadsheet is provided to illustrate these ideas in Excel without the computed probabilities.
Disable random behavior in the grid by setting the random behavior value to zero, so that values in the grid will match values from Excel.
Use the Collection Editor dialog box to specify named range values. In the illustration below, the named ranges are specified as cell coordinates, but you can enter values as well.
This sample also includes a helper class that marks row and column headers of the current cell (similar to Excel functionality) in grid.