We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to show or hide items at runtime without filtering?

Platform: Xamarin.Forms |
Control: SfListView

You can filter and show needed items in listview. In another way, you can handle QueryItemSize event and set ItemSize as 0. You can refresh the listview at runtime by calling RefreshView method which triggers QueryItemSize event again to update at runtime.



listView.ItemTapped += ListView_ItemTapped;
listView.QueryItemSize += ListView_QueryItemSize;
private void ListView_ItemTapped(object sender, Syncfusion.ListView.XForms.ItemTappedEventArgs e)
    (e.ItemData as Contacts).IsVisible = false;
private void ListView_QueryItemSize(object sender, QueryItemSizeEventArgs e)
    var contact = e.ItemData as Contacts;
    e.ItemSize = contact.IsVisible ? this.listView.ItemSize : 0;
    e.Handled = true;
bool canhide = false;
private void Button_Clicked(object sender, EventArgs e)
    canhide = !canhide;
    viewModel.contactsinfo.First(i => i.DisplayString == "Settings").IsVisible = canhide;





2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile