# DocumentController.FieldAdapterCollection.IndexOf Method

> Gets the index of the specified field adapter in the collection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DocumentServer > DocumentController.FieldAdapterCollection.IndexOf Method
- **437 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/indexof-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/indexof-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/indexof-method/llms-full.txt

---

### Description

Gets the index of the specified field adapter in the collection.

### Syntax

```csharp
public int IndexOf(FieldAdapter fieldAdapter);
```

```vbnet
Public Function IndexOf(fieldAdapter As FieldAdapter) As Integer
```

### Parameters

| Parameter | Description |
|---|---|
| fieldAdapter | Specifies the field adapter whose index should be looked up. |

### Return Value

The integer returned by the function represents the field adapter's position in the collection. If the specified field adapter is not in the collection, a negative value is returned.

### Examples

The following example uses Index Of in a focused Field Adapter Collection workflow.

```csharp
var result = fieldAdapterCollection.IndexOf(new TXTextControl.DocumentServer.Fields.CheckBoxContentControl());
Console.WriteLine($"Index Of result: {result}");
```

```vbnet
Dim result = fieldAdapterCollection.IndexOf(New TXTextControl.DocumentServer.Fields.CheckBoxContentControl())
Console.WriteLine($"Index Of result: {result}")
```

---

## Nearby

- **Previous:** [DocumentController.FieldAdapterCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/getenumerator-method/llms-full.txt)
- **Next:** [DocumentController.FieldAdapterCollection.Item Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller-fieldadaptercollection/item-property/llms-full.txt)
