none
Excel 2007 ListObject reapply Filters/AutoFilters after binding data

    Question

  • Hi,

    I am working with ListObject in Excel 2007 VSTO and my requirement is as follows:

    1. Bind data to the list object

    2. Let the user apply filters/sort after the initial binding

    3. On click of a button, my VSTO application will make a call to the database to get fresh data and bind it to the list object.

    I want to preserve the filters/sort applied by the user before he clicked on the button.

    I am able to capture all the filters except for a column that stores "Date" types.

    Surprisingly, the Filter.On property is true and the count is zero.

    Any help is very much appreciated

    Regards,

    Kiran Banda

    Monday, October 11, 2010 7:36 AM

Answers

  • Kiran,

    Despite the display format You have chosen in the Date column Excel uses the underlying values of the dates like 9/4/2010, 9/5/2010. In order to catch the filter values in use You need to use that kind of date format to check.


    Kind regards, Dennis (http://xldennis.wordpress.com/)
    Wednesday, October 13, 2010 5:08 PM

All replies

  • Kiran,

    Could You have the kindness to give some more details:

    - Which version of Visual Studio You use, i.e. 2005 or 2008 or 2010

    - "Dates" and Excel is not always a happy marriage, could You upload an example file with the dates in use to SkyDrive ?

    It will enable me to test it myself in a similar environment as You use.

     


    Kind regards, Dennis (http://xldennis.wordpress.com/)
    Monday, October 11, 2010 7:30 PM
  • Hi Dennis,

     

    Thanks for the response.

     

    we are using Visual Studio 2008 Version

     

     

     

     


    K K Sanghi Inforica India Pvt. Ltd
    Tuesday, October 12, 2010 11:03 AM
  • Kiran,

    Sorry for later reply but this message was classified as spam in my e-mail account so I just saw Your response right now. It's too late for me now so I will get back to You tomorrow my local time.


    Kind regards, Dennis (http://xldennis.wordpress.com/)
    Tuesday, October 12, 2010 10:21 PM
  • Kiran,

    Despite the display format You have chosen in the Date column Excel uses the underlying values of the dates like 9/4/2010, 9/5/2010. In order to catch the filter values in use You need to use that kind of date format to check.


    Kind regards, Dennis (http://xldennis.wordpress.com/)
    Wednesday, October 13, 2010 5:08 PM
  • Hi Kiran,

    I'm writing to check the status of the thread. Could you please let me know if you have solved the problem?

    Best Regards,
    Amy Li
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Friday, October 15, 2010 9:00 AM
  • Thanks Amy,

    Finally we got the solution.

    Regards,

     

    Krishna Sanghi


    Friday, October 22, 2010 6:11 AM