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.4 1stGrid - Step 3

This section outlines the steps for step 3 of the 1stGrid tutorial. Step 3 adds a property grid to the application, allowing the properties of a grid control to be configured at run-time.

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

8.4.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. Right click Step 3.

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

8.4.2 Add a Property Grid

The following steps create a new form for displaying the property grid.

  1. Open Form1.cs in design view.

  2. Select the form.

  3. Add a new form to hold the property grid.

  4. Size the form as desired.

  5. Change the following properties for the form:

  6. Drag a property grid from the Toolbox onto the form. Size as desired.


    The Property Grid is not present by default in the Toolbox. To add it, right-click the Toolbox, choose "Customize Toolbox...", select the .NET Framework Components tab, check the box next to Property Grid, and click OK.

  7. Drag a button from the Toolbox onto the form. Position as desired.

  8. Set the properties for the button.

  9. Add the implementation for the Click event.

  10. View the source code for the form (use the View|Code Visual Studio menu option).

  11. Add a constructor argument of type Stingray.Grid.GridControl.

  12. After the comment "TODO: Add any constructor code after InitializeComponent call", add a command to set the selected object for the property grid to the grid given to the constructor.

  13. Open the design view for Form1.cs.

  14. Right click the Window menu and select Insert New from the context menu that appears.

  15. Add the menu &Options. Set the Name property for the menu to OptionsMenu.

  16. Add the item &Grid Properties to the Options menu. Set the Name property of this item to OptionsGridProperties.

    Figure 41: Adding the Options Menu

  17. Double-click the GridProperties menu item, and add the following code for the implementation of the event handler.

  18. Build and run the application.

    Figure 42: Completed 1stGrid Step 3



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.