Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Grid for Microsoft .NET User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

8.5 1stGrid - Step 4

This section gives the steps required to complete Step 4 of the 1stGrid tutorial. Step 4 enables the Objective Grid for Microsoft .NET formula engine, and configures the grid documents to sum numbers in column two, from row 2 through row 11.

If you don't want to keep Step 3, then skip to Section 8.5.2 to continue adding the Step 4 features to Step 3.

8.5.1 Create a New Project

  1. Right click Solution '1stGrid' in Solution Explorer.

  2. From the context menu that appears, select Add | New Project.

  3. Right click and delete AssemblyInfo.cs and Form1.cs.

  4. From the command prompt or from the Windows Explorer:

  5. Visual Studio will indicate that the project has changed. Select Discard to discard any cached Step 4 project files.

  6. Right click Step 4.

  7. From the context menu that appears, select Set As Startup Project.

8.5.2 Enable the Formula Engine

The following steps enable the formula engine.

  1. Open Form1.cs in design mode.

  2. Select the form. Change the following form properties for Form1:

  3. Open the Design View for the GridDocument class.

  4. Select the grid control in the GridDocument form.

  5. Select the properties for the Grid Control.

  6. Expand the Features property (in the Configurations category).

8.5.3 Add Event Handlers

The following steps add event-handling code for the GridInitialized and EndEditing events. You handle the GridInitialize event by adding some simple titles and a formula to the grid. The formula sums the numbers in column 2, rows 2 through 11. You handle the EndEditing event by validating any user input, which should be empty text or numeric data.

  1. Select the events for the Grid Control in the property grid (click on the lightning bolt in the property grid).

  2. Double click the GridInitialized method, and add the following implementation for the GridInitialized method:

  3. Select the events for the Grid Control in the property grid (click the lightning bolt).

  4. Double click the EndEditing event, and add the following validation code:

  5. Add the following using declaration at the top of the file GridDocument.cs:

  6. Build and run the completed application.

Congratulations! You've completed the final step of the 1stGrid tutorial.

Figure 43: Completed 1stGrid Step 4



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.