# Data Binding

Data binding is a mechanism for automatic population of the RadTreeMap with items, based on the provided data structure. Three properties control the data binding:

* **DataSource** - specifies the data structure to be bound.

* **DisplayMember** - specifies the particular field in the data source which will be used from the items in RadTreeMap for their Text.

* **ValueMember** - specifies the particular field in the data source which controls the value for each item.

**RadTreeMap** supports data binding either at design time or at run time. Both of the approaches will lead to the same result:

![WinForms RadTreeMap Data Binding](https://www.telerik.com/products/winforms/documentation/assets/5f2a2a732423476c5223ff12381f4ad8/treemap-data-binding011.png)

## Run Time

```C#
this.radTreeMap1.DisplayMember = "ProductName";
this.radTreeMap1.ValueMember = "ProductID";
this.radTreeMap1.DataSource = this.productsBindingSource;
```

```VB.NET
Me.radTreeMap1.DisplayMember = "ProductName"
Me.radTreeMap1.ValueMember = "ProductID"
Me.radTreeMap1.DataSource = Me.productsBindingSource

```

## Design Time

It is possible to specify the **DataSource**, **DisplayMember**, **ValueMember** properties via the Smart Tag. The following tutorial demonstrates how to bind the tree map control to the Northwind.Products table:

![WinForms RadTreeMap Design Time Step 1](https://www.telerik.com/products/winforms/documentation/assets/bdcabccd53a13fd40ab74c2b1999d718/treemap-data-binding001.png)

![WinForms RadTreeMap Design Time Step 2](https://www.telerik.com/products/winforms/documentation/assets/f9f1e1b1657a817fdebd0af2528a5e0a/treemap-data-binding002.png)

![WinForms RadTreeMap Design Time Step 3](https://www.telerik.com/products/winforms/documentation/assets/9335d89e4484b712599c0f5648297ae3/treemap-data-binding003.png)

![WinForms RadTreeMap Design Time Step 4](https://www.telerik.com/products/winforms/documentation/assets/8c66323207b6691c465696ad71fbea8c/treemap-data-binding004.png)

![WinForms RadTreeMap Design Time Step 5](https://www.telerik.com/products/winforms/documentation/assets/2b6d4ae50bd70e9bba3b4052c9218a67/treemap-data-binding005.png)

![WinForms RadTreeMap Design Time Step 6](https://www.telerik.com/products/winforms/documentation/assets/7534fd7f7e746ea1312c6e23cd9043d1/treemap-data-binding006.png)

![WinForms RadTreeMap Design Time Step 7](https://www.telerik.com/products/winforms/documentation/assets/a749c35e6848d8e8ade995234f61390f/treemap-data-binding007.png)

![WinForms RadTreeMap Design Time Step 8](https://www.telerik.com/products/winforms/documentation/assets/04cac4f1798de906227bf6984ed4ab1d/treemap-data-binding008.png)

![WinForms RadTreeMap Design Time Step 9](https://www.telerik.com/products/winforms/documentation/assets/ecde71118ff1f289e9f2085421e51a3c/treemap-data-binding009.png)

![WinForms RadTreeMap Design Time Step 10](https://www.telerik.com/products/winforms/documentation/assets/f319ca8286c5ccce2783794421b3e164/treemap-data-binding010.png)

## See Also

* [Structure](https://www.telerik.com/products/winforms/documentation/controls/treemap/structure)

* [Layout Strategies](https://www.telerik.com/products/winforms/documentation/controls/treemap/layout-strategies)

* [Getting Started](https://www.telerik.com/products/winforms/documentation/controls/treemap/getting-started)

* [Unbound Mode](https://www.telerik.com/products/winforms/documentation/controls/treemap/unbound-mode)
