Forum Xamarin.Forms

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Picker in listview

hadeelhadeel Member ✭✭
edited December 2019 in Xamarin.Forms

hi, everyone,
I face the following problem,
My app is simple, there is a listview contains 10 items each item contains picker and label,
and I have a save button at the end of the page
when clicking a button I need to collect data that is selected from each picker in the list
the problem is that when I scroll the list down NullReferenceException appears

I don't find a way to solve it
can anybody help, please?

the picture attached describes the problem.

any help, Please!

Best Answers

  • hadeelhadeel Member ✭✭
    Accepted Answer

    @Jarvan
    can you show me your full demo code Please?
    I try to change the code as you tell me but the problem still exists

  • hadeelhadeel Member ✭✭
    Accepted Answer

    @Jarvan thank you so much.
    I think that there is another reason for that which is the ListView performance,
    so I removed the following property from listview tag in my XAML code
    CachingStrategy="RecycleElement"
    then it works fine.

Answers

  • hadeelhadeel Member ✭✭
    Accepted Answer

    @Jarvan
    can you show me your full demo code Please?
    I try to change the code as you tell me but the problem still exists

  • hadeelhadeel Member ✭✭
    Accepted Answer

    @Jarvan thank you so much.
    I think that there is another reason for that which is the ListView performance,
    so I removed the following property from listview tag in my XAML code
    CachingStrategy="RecycleElement"
    then it works fine.

Sign In or Register to comment.