I want to create a list view with four column, first two column will have text and next two column will have clickable button(image). Number of rows is not fixed- so data binding is require. Should support android and iOS. please suggest which xamarin control will be best suited for me.
Can i use data template as shown in https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/templates/data-templates/selector/
or should use Grid, Grid layout or any other.
======== Solution Applied=============
<ListView x:Name="listViewExpenses" CachingStrategy="RecycleElement" VerticalOptions="FillAndExpand" RowHeight="40">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<!--<Label x:Name="idLabel" Text="{Binding Id}"/>-->
<Label x:Name="textLabel1" Grid.Column="0" Text="{Binding Text}"/>
<!--<Button x:Name="btnEdit" Image="icon.png" HeightRequest="50" WidthRequest="50" Grid.Column="2" CommandParameter="{Binding Id}" Clicked="OnEditClicked" />-->
<StackLayout Grid.Column="1">
<Image Source="EditRed.png" VerticalOptions="Center" >
<Image.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnEditTapped"
CommandParameter="{Binding Id}"/>
</Image.GestureRecognizers>
</Image>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>`enter code here`
===================================== Thanks,
@paul