# Treeview Data Binding to Flat Data

This article explains how to bind the TreeView for Blazor to flat data.

> tip Before continuing, make sure you are familiar with the [TreeView data binding basics](https://www.telerik.com/blazor-ui/documentation/components/treeview/data-binding/overview).

Flat data means that the entire collection of treeview items is available at one level, for example `List<MyTreeItemModel>`.

The parent-child relationships are created through internal data in the model - the `Parent` field which points to the `Id` of the item that will contain the current item. The root level has `null` for `Parent`. There must be at least one node with a `null` value so that the TreeView renders anything.

You must also provide the correct value for the `HasChildren` field - for items that have children, you must set it to `true` so that the expand arrow is rendered.

> caption Example for flat data in a Treeview, using non-default ParentIdField

<demo metaUrl="client/treeview/data-binding/flat-data/example-1/" height="420"></demo>

## See Also

* [TreeView Data Binding Basics](https://www.telerik.com/blazor-ui/documentation/components/treeview/data-binding/overview)
* [Live Demo: TreeView Flat Data](https://demos.telerik.com/blazor-ui/treeview/flat-data)
* [Binding to Hierarchical Data](https://www.telerik.com/blazor-ui/documentation/components/treeview/data-binding/hierarchical-data)
* [Load on Demand](https://www.telerik.com/blazor-ui/documentation/components/treeview/data-binding/load-on-demand)
