EditorPartCollection.IndexOf Method

Note: This method is new in the .NET Framework version 2.0.

Returns the position of a particular member of the collection.

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)

public:
int IndexOf (
	EditorPart^ editorPart
)
public int IndexOf (
	EditorPart editorPart
)
public function IndexOf (
	editorPart : EditorPart
) : int

Parameters

editorPart

An EditorPart that is a member of the collection.

Return Value

An integer that corresponds to the index of an EditorPart control in the collection.

The IndexOf method is useful if you have multiple EditorPart controls on a Web Parts page, and you need to locate a particular control in the collection.

The following code example demonstrates how to use the IndexOf method to locate an EditorPart control in an EditorPartCollection object. For the full code required to run the example, see the Example section of the EditorPartCollection class overview.

The code in the Button1_Click event creates an EditorPartCollection object, and then uses the IndexOf method to locate the PropertyGridEditorPart1 control in the collection, and set its ChromeType property.

No code example is currently available or this language may not be supported.

When you load the page in a browser, you can switch the page into edit mode by selecting Edit in the Display Mode drop-down list control. You can click the verbs menu (the downward arrow) in the title bar of the TextDisplayWebPart control, and click Edit to edit the control. When the editing user interface (UI) is visible, you can see all the EditorPart controls. If you click the Create EditorPartCollection button, you will notice that the PropertyGridEditorPart1 control, which is near the bottom of the page, has a title but no border.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: