Posted 8 September 2017, 1:21 pm EST
The way the default filters work, every time a new value is added in a column, a new filter appears to allow filtering based on that value. What I would like to do is every time one of these filters is added, I want one of my custom filters to be added as well for that same item. The goal is to be able to filter not only for matching values, but similar values as well. I have the custom filter defined and have successfully added a single instance of it. Now I want to dynamically add instances whenever needed.
I tried handling the SheetView.RowFilter.ColumnDefinitions.Changed event, but I had a hard time getting around the StackOverflows since every time a ColumnDefinition is added, including my own, it fires the event twice. I tried using a flag to determine whether to handle the event or not, but that only stops one of the events. I suppose I could throw a second flag in there or possibly refine the logic behind the flag, but that's starting to be more work than I want to put into this functionality. Is there an easier way?