Skip to content

Commit 4c37119

Browse files
committed
Updated the README.md file
1 parent 2be2793 commit 4c37119

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11
# How to show empty message when listview has no items in xamarin forms
22
This example demonstrates to show empty message when listview has no items by using the visibility property.
33

4+
## Sample
5+
6+
```xaml
7+
<Grid Padding="{OnPlatform iOS='0,40,0,0'}">
8+
<Grid.RowDefinitions>
9+
<RowDefinition Height="50"/>
10+
<RowDefinition Height="*"/>
11+
</Grid.RowDefinitions>
12+
<Button x:Name="ItemSource" Grid.Row="0"
13+
Text="Change ItemSource"
14+
HorizontalOptions="CenterAndExpand"
15+
VerticalOptions="CenterAndExpand"
16+
Command="{Binding OnItemsSourceChanged}"/>
17+
<Grid IsVisible="{Binding IsVisible}" Grid.Row="1">
18+
<Label x:Name="label"
19+
Text = "No Items :("
20+
FontSize ="Default"
21+
HorizontalOptions = "FillAndExpand"
22+
HorizontalTextAlignment = "Center"
23+
VerticalTextAlignment = "Center"
24+
VerticalOptions = "FillAndExpand"/>
25+
</Grid>
26+
<syncfusion:SfListView x:Name="listView" Grid.Row="1" ItemsSource="{Binding ContactsInfo}"
27+
IsVisible="{Binding Path=IsVisible, Converter={StaticResource visibilityConverter}}"
28+
ItemSpacing="2" ItemSize="30">
29+
<syncfusion:SfListView.ItemTemplate>
30+
<DataTemplate>
31+
<Label Text="{Binding ContactName}"/>
32+
</DataTemplate>
33+
</syncfusion:SfListView.ItemTemplate>
34+
</syncfusion:SfListView>
35+
</Grid>
36+
```
37+
438
See [How to show empty message when listview has no items in Xamarin.Forms](https://www.syncfusion.com/kb/9956/how-to-show-empty-message-when-listview-has-no-items-in-xamarin-forms) for more details.
539
## <a name="requirements-to-run-the-demo"></a>Requirements to run the demo ##
640

0 commit comments

Comments
 (0)