Any way to search among two seperate bindings in Listview?

SebCSebC NZMember
edited December 2016 in Xamarin.Forms

Hey guys, so I have setup two separate bindings, lets say it is first name and last name. Right now I have the list view populated by last name first, then first name. And I also have a search function setup, which filters the results based on last name. I was wondering if there were any way in which I can filter the results by either first name or last name at the same time. I tried to do the || function but it returned an error saying lambda experssion not allowed. For full reference I was trying to do something like listview.ItemSource = list.Where(i => i.FirstName.Lower...... || i => i.LastName......)

Best Answer

  • ionixjuniorionixjunior US ✭✭✭
    Accepted Answer

    Try list.Where(i => (i.FirstName.Lower ........ || i.LastName....) )

    You can't repeat i =>.

Answers

  • ionixjuniorionixjunior USMember ✭✭✭
    Accepted Answer

    Try list.Where(i => (i.FirstName.Lower ........ || i.LastName....) )

    You can't repeat i =>.

  • SebCSebC NZMember

    Thanks ionixjunior! That works. I have learnt a new thing as well. :smile:

Sign In or Register to comment.