# Data Binding

In this topic, you will get all information related to binding data in Treeview.

## Content



The process of connecting a data consumer with a data source is known as data binding. TreeView for WinForms supports data binding in two modes: unbound mode and bound mode.

The unbound mode means that the TreeView control is not bound to any data source. In the unbound mode, you need to create columns and nodes manually either by using designer or programmatically. To create nodes in the unbound mode at design-time, you can simply add the nodes in **TreeNodes Editor.** For more details on how to access TreeNodes Editor, refer to [Collection Editors](/componentone/docs/win/online-treeview/concepts/DesignTimeSupport). If you want to create nodes in the unbound mode programmatically, you can do so by using the [Add](/componentone/docs/win/online-treeview/) and the [Insert](/componentone/docs/win/online-treeview/) methods. For more information, refer to [add](/componentone/docs/win/online-treeview/features/Nodes/add-nodes) nodes and [remove](/componentone/docs/win/online-treeview/features/Nodes/remove-nodes) nodes.

In the bound mode, the TreeView control uses data from a data source and displays it in the form of parent and child nodes in a hierarchical manner. TreeView supports a number of data source objects, namely, BindingSource, List, DataView, DataTable, DataSet, and objects implementing particular interfaces like IBindingList and IList.

To bind TreeView to a data source object, you need to use the DataSource property of <span data-popup-content="This class is available in C1TreeView classes of both \u003ca href=\u0022/componentone/docs/win/online-treeview/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-treeview/\u0022\u003e.NET\u003c/a\u003e assemblies." data-popup-title="C1TreeView" data-popup-theme="ui-tooltip-green qtip-green">C1TreeView</span>. You can specify the type of the bound mode for TreeView by setting the TreeBoundMode property to one of the following values from the TreeBoundMode enumeration:

*   **OneWay**: Does not update the data source after the treeview hierarchy changes.
*   **TwoWay**: Updates the data source after the treeview hierarchy changes

Once you have set the data source, you can set the list of fields to display in columns by using the [DisplayFieldName](/componentone/docs/win/online-treeview/) property of [C1TreeColumn](/componentone/docs/win/online-treeview/). For more information, see [TreeView Columns](/componentone/docs/win/online-treeview/features/treeview-columns).

Refer to the following topics to know how you can bind TreeView to different objects:

*   [Binding List](/componentone/docs/win/online-treeview/features/DataBinding/bind-treeview-with-binding-list)
*   [Self-Referencing](/componentone/docs/win/online-treeview/features/DataBinding/self-referencing)
*   [DataSet Binding](/componentone/docs/win/online-treeview/features/DataBinding/binding-dataset)
*   [XML Binding](/componentone/docs/win/online-treeview/features/DataBinding/xml-binding)