# bindItem

> Callback for binding a data item to the visual element.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
[CreateProperty]
public Action<VisualElement, int> bindItem { get; set; }
```

### Remarks

The method called by this callback receives the VisualElement to bind, and the index of the element to bind it to.

If this property and [TreeView.makeItem](/engine/6000.0/script-reference/unityengine/uielements/treeview/makeitem.md) are not set, Unity will try to bind to a SerializedProperty if bound, or simply set text in the created Label.

**Note:**: Setting this callback without also setting [TreeView.unbindItem](/engine/6000.0/script-reference/unityengine/uielements/treeview/unbinditem.md) might result in unexpected behavior. This is because the default implementation of unbindItem expects the default implementation of bindItem.
