This documentation is archived and is not being maintained.

showGrid Property

Visual Studio .NET 2003

The showGrid property of an HTML document determines whether the positioning grid will be displayed in Design view. The values available for this property are:

  • True (display grid)
  • False (hide grid)

You can set the showGrid property either from the Properties window or from the DOCUMENT Property Pages dialog box. For more information, see Setting the showGrid Property of an HTML Document.

When the pageLayout property is set to GridLayout, the showGrid property can be set to True. This will display the Design view positioning grid. If you have enabled Snap to Grid in the Display, HTML Designer, Options dialog box, it is also activated. Elements dragged across the Design view surface will automatically be aligned with the nearest positioning grid guidelines when you release the mouse.

Setting the showGrid property in Visual Studio .NET inserts a <META NAME=vs_showGrid> element into the <HEAD> portion of an HTML document:

<meta name="vs_showGrid" content="TRUE">.
Note   The positioning grid and Snap to Grid are available only in Design view.

When you set the value of the pageLayout property to "GridLayout," you can then set the value of the showGrid property to True and display the Design view positioning grid. If Snap to Grid is enabled in the Display, HTML Designer Options dialog box, it is activated. Elements dragged across the Design view surface will automatically be aligned with the nearest positioning grid guidelines when you release the mouse. For more information, see Positioning HTML Elements in Design View.

Remember that switching views can reformat your markup. For more information, see Switching to Design View.

See Also

HTML and XML Schema Extensibility | Properties Window | General Tab, DOCUMENT Property Pages Dialog Box | Display, HTML Designer, Options Dialog Box | Position, Style Builder Dialog Box | Design View, HTML Designer | HTML View, HTML Designer

Show: