The grid control is a spreadsheet-like object. The Address Book application uses it to display data returned from queries.
The following HTML code defines the grid control:
<OBJECT CLASSID="clsid:BC496AE0-9B4E-11CE-A6D5-0000C0BE9395"
ID=Grid1
CODEBASE="HTTP://<%=Request.ServerVariables("SERVER_NAME")%>/MSADC/Samples/Sheridan.cab"
HEIGHT= 125
Width = 495>
<PARAM NAME="AllowAddNew" VALUE="TRUE">
<PARAM NAME="AllowDelete" VALUE="TRUE">
<PARAM NAME="AllowUpdate" VALUE="TRUE">
<PARAM NAME="BackColor" VALUE="-2147483643">
<PARAM NAME="BackColorOdd" VALUE="-2147483643">
<PARAM NAME="ForeColorEven" VALUE="0">
</OBJECT>
The OBJECT tag defines the grid control component to the program. The tag includes parameters that allow you to set the size of the grid, change the data displayed when information is updated or deleted, and dynamically change the number of rows according to the results of a query. The other parameters set the color properties of the grid control.
The following table describes the parameters associated with the OBJECT tag.
| Parameter | Description |
| ID | Defines a document-wide identifier for the embedded object. The AdvancedDataControl object uses this ID in the Bindings property to bind the grid to the data. |
| WIDTH and HEIGHT | Identifies the dimensions of the control, in pixels. |
| CODEBASE |
Specifies the location of a source file of the object being called, if it is not on the client computer.
In this case, CODEBASE specifies the location of a .cab file containing the Sheridan ActiveX controls. The program uses Active Server Pages script (the code enclosed by the |
| CLASSID | A unique, 128-bit number that identifies the type of embedded object to the system. This identifier is maintained in the local computer's Windows registry. It is specific to this Sheridan grid control. |
For the Address Book application, the grid object uses several additional parameters to enable editing. Without these specifiers, the grid can only present a read-only, static view of the data. The following table lists editing parameter settings for the grid control in this sample application.
| Parameter | Value | Description |
| AllowUpdate | TRUE | Allows changes to a cell in the grid. |
| AllowAddNew | TRUE | Allows an existing data display to add new records. |
| AllowDelete | TRUE | Allows an existing data display to remove records. |
The BackColor, BackColorEven, and BackColorOdd parameters set the grid to a white background with black text.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.