Articles in this section
Category / Section

How to show or hide items at runtime without filtering?

1 min read

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;





Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment