EditorPartCollection.IndexOf Method
Assembly: System.Web (in system.web.dll)
public int IndexOf ( EditorPart editorPart )
public function IndexOf ( editorPart : EditorPart ) : int
Not applicable.
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 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.
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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.