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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to clear autofilters

Thread ID:

Created:

Updated:

Platform:

Replies:

84407 Jun 30,2009 04:24 PM UTC Jul 2,2009 06:21 AM UTC Windows Forms 3
loading
Tags: XlsIO
Wout de Zeeuw
Asked On June 30, 2009 04:24 PM UTC

Hi,

I'm trying to clear autofilters, but can't figure out how to do it. Is there any example code somewhere? IWorksheet.AutoFilters.FilterRange seems to be close, but how to set it to an empty range? I can't set it to null.

Thanks!

Wout

Geetha M [Syncfusion]
Replied On July 1, 2009 11:48 AM UTC

Hi Wout,

Thank you for your continued interest in Syncfusion products.

Currently it is not possible to clear filters. But you can workaround this by changing the current FilterRange. You can check the code snippet below.

sheet.AutoFilters.FilterRange = sheet[30,20];

Please try this and let me know if you have any questions.

Regards,
Geetha

Wout de Zeeuw
Replied On July 1, 2009 03:36 PM UTC

Hi,

I tried this workaround, which works ok luckily:

CType(newWorkSheet.AutoFilters, Syncfusion.XlsIO.Implementation.Collections.AutoFiltersCollection).Clear()

If the AutoFilters (IAutoFilters) interface could expose the Clear() method, then the ugly cast wouldn't be needed.

Best regards,

Wout

Geetha M [Syncfusion]
Replied On July 2, 2009 06:21 AM UTC

Hi Wout,

Thank you for the details.

I have logged a feature request on this regard and will get back to you once it is implemented.

Regards,
Geetha

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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

;