Height Property
The document is archived and information here might be outdated

WebPart.Height Property

Windows SharePoint Services 3

Gets or sets the fixed height for a Web Part on a Web Part Page.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

[WebPartStorageAttribute(Storage = Storage.Personal)]
public string Height { get; set; }

Property Value

Type: System.String
A string value that specifies the fixed height of the Web Part. Any height value that is allowed in CSS can be used. The default value is String.Empty.

Use this property to restrict the height of a Web Part on a Web Part Page. If this property is not set or if it is set to Empty, the Web Part is allowed to grow to be as big as its content within the limits of the zone that contains it.

The value of string is a number followed by a two-character abbreviation that indicates a unit of measure, for example, 50px for 50 pixels. If no unit of measure is indicated, the number defaults to pixels. The following units of measure are supported:

  • cm (centimeters)

  • in (inches)

  • mm (millimeters)

  • pc (picas)

  • pt (points)

  • px (pixels)

This property can be personalized by individual users. Its WebPartStorageAttribute value is Storage.Personal, which specifies that the property can be stored on a per-user basis. Only users with the Personalize Web Part pages right can set this property. It can be set programmatically, or it can be set through the Web Part task pane in the personal view of the Web-based user interface, or by using a Windows SharePoint Services–compatible HTML editor, such as Microsoft Office SharePoint Designer 2007.

© 2016 Microsoft