Getting error "System.NullReferenceException: Object reference not set to an instance of an object". I'm trying to retrieve names from my dummy SQLite database.My search TextChanged function definition;/// void Member_Searchbar_TextChanged(object sender, EventArgs e) { string keyword = MemberSearchBar.Text; MemberlistView.BeginRefresh(); if (string.IsNullOrWhiteSpace(keyword)) { MemberlistView.ItemsSource = App.Database.GetFriends(); } else { IEnumerable searchRes = App.Database.GetFriends().Where(x => x.Fname.Contains(keyword)); MemberlistView.ItemsSource = searchRes; } MemberlistView.EndRefresh(); }//////Friends is my viewmodel, GetFriends to query to select all friends, and Fname is an entry in Friends.
thank you Houssem please i want to ask why search bar text is always is empty private void MainSearchBar_OnSearchButtonPressed(object sender, EventArgs e) { string keyword = MainSearchBar.Text; DisplayAlert("title", keyword, "cancel"); // IEnumerable serachResult= _names.Where(name => name.Contains(koko)); // MainListView.ItemsSource = serachResult; } i test in windows emulator and android but when write in search bar not show any thing
Your videos are great! Straight to the point! Thanks for sharing.
thanks for the very straight forward tutorial. I subscribed, and hope to find other great videos as well
Hello Houssem Dellai, I would like to ask you, can we make a search bar, but the data is from the database?
Please make a tutorial :)
Hi Houssem !
Thank you to share with us. Nice video.
Is it possible to make a new video based on this on, but with MVVM approach?
Best regards,
Ciro.
Are you find it ? I'm looking for too.
Any video where you show how to data from a secondary page to the main page?
Hi i want to implement this using mvvm , observablecollection and inotifypropertychanged but things are not working..can u pls help me out here
Getting error "System.NullReferenceException: Object reference not set to an instance of an object". I'm trying to retrieve names from my dummy SQLite database.My search TextChanged function definition;/// void Member_Searchbar_TextChanged(object sender, EventArgs e)
{
string keyword = MemberSearchBar.Text;
MemberlistView.BeginRefresh();
if (string.IsNullOrWhiteSpace(keyword))
{
MemberlistView.ItemsSource = App.Database.GetFriends();
}
else
{
IEnumerable searchRes = App.Database.GetFriends().Where(x => x.Fname.Contains(keyword));
MemberlistView.ItemsSource = searchRes;
}
MemberlistView.EndRefresh();
}//////Friends is my viewmodel, GetFriends to query to select all friends, and Fname is an entry in Friends.
thank you Houssem please i want to ask why search bar text is always is empty
private void MainSearchBar_OnSearchButtonPressed(object sender, EventArgs e)
{
string keyword = MainSearchBar.Text;
DisplayAlert("title", keyword, "cancel");
// IEnumerable serachResult= _names.Where(name => name.Contains(koko));
// MainListView.ItemsSource = serachResult;
}
i test in windows emulator and android but when write in search bar not show any thing
That's weird ! Try sharing your XAML code, please ?
i had the issue but it was solved after a Rebuild
.Contains is not showing whyyy ? can you help please
Thanks a lot .! great videos :D
that is working only in android emulator when press on enter in keyboard . but it is not working when press search button on emulator
Oh yeah! It doesn't work from the icon! I think it is Okay siince users are more familiar/expecting with search button on the keyboard :)
Cancel button is not working also. It should reset the ListView on cancel
I'm not sure why is that behavior!
work with TextChanged event
Thanks