# DataBinding - Overview

**Data binding** is a process of connecting the application User Interface and business logic.

## DataContext

One very important aspect of the data binding is the **DataContext**. It is the data object, which is assigned to the specific framework element. You can assign **DataContext** both through code-behind and XAML:

```XAML
<telerik:RadTreeView DataContext="{StaticResource Categories}" />
```

```C#
radTreeView.DataContext = new CategoryList();
```

```VB.NET
	radTreeView.DataContext = New CategoryList()
```

The **DataContext** property is inherited, e.g. if you assign a **DataContext** to an element, all of its children will automatically have the same data context, unless you assign them a different data context. For example, if you have the following control structure:

```XAML
<Grid x:Name="LayoutRoot">
    <telerik:RadTreeView x:Name="radTreeView1"/>
    <telerik:RadTreeView x:Name="radTreeView2"/>
</Grid>
```

You can simply assign the **DataContext** to the **Grid** control and both tree views will inherit it.

```XAML
<Grid x:Name="LayoutRoot2" DataContext="{StaticResource categories}">
</Grid>
```

Where the static resource **categories** is defined in XAML as follows:

```XAML
<UserControl.Resources>
    <local:CategoryList x:Key="categories" />
</UserControl.Resources>
```

Or in code-behind:

```C#
LayoutRoot.DataContext = new CategoryList();
```

```VB.NET
	LayoutRoot.DataContext = New CategoryList()
```

## See Also

* [Populating with Data - Declaratively](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/populating-with-data/declaratively)
* [Populating with Data - In Code-Behind](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/populating-with-data/in-code-behind)
* [Binding to XML](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/populating-with-data/data-binding-to-xml)
* [Binding to Object](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/populating-with-data/data-binding-to-object)
* [Binding to WCF Service](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/populating-with-data/databinding-to-wcf-service)
* [Binding to ADO.NET Data Service](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/populating-with-data/databinding-to-adonet-service)
* [Hierarchical Data Templates](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/populating-with-data/hierarchical-data-templates)
