# .NET MAUI DataGrid Empty Template

The [.NET MAUI DataGrid](https://www.telerik.com/maui-ui/documentation/controls/datagrid/overview) control provides the ability to specify a template when the `ItemsSource` is null or collection is empty.

It exposes the following properties:

* `EmptyContentTemplate`(`DataTemplate`)—Defines the content of the view which is shown when in the view has no items.

* `EmptyContentDisplayMode`—Defines the modes for displaying empty content. The property have two modes:
  \- `ItemsSourceNull`—Displays the empty content view only when the `ItemsSource` is null.
  \- `ItemsSourceNullOrEmpty`—Displays the empty content view when `ItemsSource` is null or when the source is empty(has zero items).

## Example

**1.** Add DataGrid definition in XAML:

```XAML
<telerik:RadDataGrid x:Name="dataGrid"
                     EmptyContentTemplate="{StaticResource EmptyContentTemplate}"/>
```

**2.** Add `DataTemplate` Resources:

```XAML
<ResourceDictionary>
    <DataTemplate x:Key="EmptyContentTemplate">
        <Label Margin="10" TextColor="Black" HorizontalOptions="Center" Text="No data to display"/>
    </DataTemplate>
</ResourceDictionary>
```

## See Also

* [Filtering](https://www.telerik.com/maui-ui/documentation/controls/datagrid/filtering/overview)
* [Grouping](https://www.telerik.com/maui-ui/documentation/controls/datagrid/grouping/overview)
* [Selection](https://www.telerik.com/maui-ui/documentation/controls/datagrid/selection)
