We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Removing AutoFilter on ListObject

Hi,
tableInSheet.AutoFilter.RemoveFilter(0);
tableInSheet.AutoFilter.Refresh(true);

Above code does not make all rows visible in the list object. Other articles suggested below code:
tableInSheet.AutoFilter.Range = null;

But this code also does not work.

  1. It does not make all rows visible.
  2. It removes the filter option from the header column (check attached image).

Is there anything i am missing here?

Thanks,
Sanjay A.
FiltersRemoved.png (19.4 KB)

UPDATE:

if I use
int[] rowindexes = tableInSheet.AutoFilter.Refresh(true);
then above mentioned issue happens on setting Range to null.
but, if the filter is applied as:
int[] rowindexes = tableInSheet.AutoFilter.Refresh(false);
then on setting Range to null => all rows will be visible, but the Filter option is gone from the headers.

Anyways, my requirement is fulfilled by
int[] rowindexes = tableInSheet.AutoFilter.Refresh(false);
tableInSheet.AutoFilter.RemoveFilter(0);

Thanks,
Sanjay A.

@SanjayAswale,
Good to know that your issue is sorted out. Please feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.