Category / Section
How to load a listview in xamarin.forms tableview?
1 min read
Xamarin.Forms ListView can be loaded inside a Xamarin.Forms TableView. The following code demonstrates how to load a ListView in TableView.
To know more about the TableView, refer to this link: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/tableview
Xaml
<ContentPage xmlns:syncfusion="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms" > <ContentPage.Content> <TableView Intent="Data" HasUnevenRows="True" VerticalOptions="FillAndExpand"> <TableView.Root> <TableSection Title="ListView In TableView" > <ViewCell> <ViewCell.View> <syncfusion:SfListView x:Name="listView" ItemsSource="{Binding contactsinfo}”> <syncfusion:SfListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid> <Label Text="{Binding ContactName}"/> <Label Text="{Binding ContactNumber}"> </Grid> </ViewCell> </DataTemplate> </syncfusion:SfListView.ItemTemplate> </syncfusion:SfListView> </ViewCell.View> </ViewCell> </TableSection> </TableView.Root> </TableView> </ContentPage.Content> </ContentPage>
Screenshots:
Sample link: Load ListView in TableView