How To Customize The Appearance Of Empty View Using Emptyviewtemplate In .NET MAUI Listview (Sflistview)?
empty-view
emptyview
listview
maui
maui-listview
net-maui
This demo shows about how to customize the appearance of empty view using EmptyViewTemplate in .NET MAUI ListView (SfListView).
XAML
<syncfusion:SfListView x:Name="listView"
Grid.Row="3"
SelectionMode="None"
ItemsSource="{Binding Items}"
ItemSize="56">
<syncfusion:SfListView.EmptyView>
<local:FilterItem Filter="{Binding Source={x:Reference filterText},Path=Text}"/>
</syncfusion:SfListView.EmptyView>
<syncfusion:SfListView.EmptyViewTemplate>
<DataTemplate>
<Label Text="{Binding Filter,StringFormat='{0} is not found'}" HorizontalTextAlignment="Center" VerticalOptions="CenterAndExpand"
FontSize="18" FontFamily="Roboto-Regular" TextColor="#666666" Margin="16,0,16,0"/>
</DataTemplate>
</syncfusion:SfListView.EmptyViewTemplate>
<syncfusion:SfListView.ItemTemplate>
---
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView>
Requirements to run the demo
- Visual Studio 2017 or Visual Studio for Mac
- Xamarin add-ons for Visual Studio (available via the Visual Studio installer).
Troubleshooting
Path too long exception
If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.