lundi 25 mars 2019

how to add checkbox in listview using xamarin forms

i want to create a checkbox in listview using xaml, after selecting the multiple checkbox click button to get all selected value.My code is :

<ContentPage.Content>
    <ListView  x:Name="ProductsListView">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <ViewCell.View>
                        <StackLayout Spacing="0">
                            <Label Text="{Binding retail_modified_item_id}" 
                               TextColor="Blue" FontSize="13" />
                            <Label Text="{Binding name, StringFormat='Name : 
                               {0:N}'}" TextColor="black" FontSize="10"  />
                            <Label Text="{Binding retail_price, 
                               StringFormat='Price : {0:N}'}" 
                               TextColor="black" FontSize="10" />
                        </StackLayout>
                    </ViewCell.View>
                </ViewCell>                            
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</ContentPage.Content>

my output is; output without checkbox

i tried some sample code from https://www.ignatiuz.com/blog/xamarin/button-check-box-with-list-item-in-xamarin-forms-listview/

but i'm getting input:checkbox not found

i am new to xamarin please give some sample code or link to do this




Aucun commentaire:

Enregistrer un commentaire