DataGrid Empty Template
The DataGrid
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 there are 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).
-