# Data Binding

The Kendo UI for Angular ListBox is a component that displays a list of items.

The [`data`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#data) input of the ListBox accepts an array of items - strings or objects.
If objects are used, it is necessary to pass a [`textField`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#textfield) input to the component, so that the correct text can be displayed for each item.

It is important to note that out of the box, the component is purely presentational and the buttons of its toolbar are not tied to a specific behavior. Instead, the ListBox emits an [`action`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#action) event every time a button is pressed.

There are two ways to make the buttons work:

<Row>
  <Column count={[24,24,12]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#automatic-data-processing">
      <ComponentTitle>Automatic Data Processing</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Use kendoListBoxDataBinding directive to handle actionClick events automatically and connect multiple listboxes.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,12]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#manual-data-management">
      <ComponentTitle>Manual Data Management</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Bind to the actionClick event and handle actions manually for full flexibility.</ComponentDescription>
    </Component>
  </Column>
</Row>

## Automatic Data Processing

Use the [`kendoListBoxDataBinding`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/databindingdirective) directive which handles the [`action`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#action) events automatically. When the end user interacts with the toolbar, the directive modifies the original data array accordingly. As an added benefit, the directive accepts the [`connectedWith`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/databindingdirective#connectedwith) input property, which lets the user connect multiple listboxes together and move items between them.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listbox/data-binding/directive/source.txt)

## Manual Data Management

Bind to the [`action`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#action) event and modify your data in its handler. This allows for full flexibility with regard to handling actions.

Some other useful building blocks for the manual handling of the [`action`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#action) events, are the [`select`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#select) method and the [`selectedIndices`](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api/listboxcomponent#selectedindices) field of the ListBox.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/listbox/data-binding/manual/source.txt)

## Suggested Links

* [API Reference of the ListBox](https://www.telerik.com/kendo-angular-ui-develop/components/listbox/api)
