This section lists the steps required to create the first iteration of the 1stGrid application. The first iteration of the application is a very simple Windows Forms application with a single form containing one Objective Grid for Microsoft .NET grid control. The first two cells in column one of the grid are initialized with the text "Hello" and "World", respectively.
Open Microsoft Visual Studio.
Create a new, blank solution using the menu option File | New | Blank Solution.
Name the solution "1stGrid".
Give the solution any valid location (path) desired.
Add a new project to the solution.
In the solution explorer, right-click the 1stGrid solution to bring up the solution context menu (Figure 32).
From the context menu, select Add | New Project.
Click Visual C# Projects. This brings up the Add New Project dialog (Figure 33).
Select Windows Application.
Name the project "Step 1".
Click OK. A main form (Form1) is automatically added to the project, and displayed. The form is displayed in design mode. Resize the form as desired.
Select Form1. If the properties for Form1 are not already displayed, then right click the form to display a context menu. Select Properties from the context menu.
In the property grid for the form, change the following property:
Set Text to "1stGrid Tutorial Step 1".
You are now ready to add a Grid Control to Form1. Access the Windows Forms Toolbox, by selecting the View | Toolbox menu option.
Select and drag a GridControl from the Toolbox onto the form.
Size and position the grid as desired.
Select the Grid Control. In the property grid for the control, set the properties shown in Table 31
Property | Value |
DrawGrid | false |
BorderStyle | Sunken |
Anchor | Top, Bottom, Left, Right |
AutoScroll | true |
ColCount | 15 |
RowCount | 40 |
Select the Grid Control in the form.
Click the events button in the properties grid (the lightning bolt).
Double click the GridInitialized event (in Grid Control Events). Add the following code to handle the event.
gridControl1[1,1].Style.Value = "Hello"; gridControl1[2,1].Style.Value = "World"; |
Build and run the application.
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.