WebPartToolPart Class

The WebPartToolPart class represents a tool part that can be used to show and modify Web Part base class properties.

System.Object

      System.Web.UI.Control

            Microsoft.SharePoint.WebPartPages.ToolPart

                  Microsoft.SharePoint.WebPartPages.WebPartToolPart

Public Constructors

The following table shows the constructors of the WebPartToolPart class and gives a brief description of each.

Name Description
WebPartToolPart Initializes a new instance of the WebPartToolPart class.

Public Methods

The following table shows the public methods of the WebPartToolPart class and gives a brief description of each.

Name Description
ApplyChanges Applies all property changes to the instantiated tool part on the server.
Expand(Categories) Expands the specified category.
Hide(Properties) Hides the specified property.
ShouldAddProperty(System.Reflection.PropertyInfo) Specifies whether a property should be created for the specified PropertyInfo object.
SyncChanges Refreshes the tool parts displayed in the tool pane after the ApplyChanges method has successfully applied all property changes to the instantiated web part on the server.

Protected Methods

The following table shows the protected methods of the WebPartToolPart class and a brief description of each.

Name Description
CreateChildControls Notifies server controls to create any child controls that they contain in preparation for posting back or rendering.

Example

The following simple Web Part example demonstrates the use of the WebPartToolPart and the CustomPropertyToolPart to customize the display of Web Part properties in the tool pane. The example overrides the GetToolParts method of the WebPart base class in order to display the Web Part's standard properties in the tool pane followed by its custom properties, then to expand specific sections of each tool part and to hide specific standard properties. The WebPartToolPart automatically displays the web part's standard properties, and the CustomPropertyToolPart automatically displays the web part's custom properties.

Requirements

Namespace: Microsoft.SharePoint.WebPartPages

Platforms: Windows Server 2003

Assembly: Microsoft Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security