From 5dcdf670beac37a3a65729f7710bdb418a6f1d99 Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Mon, 16 May 2022 11:58:36 -0600 Subject: [PATCH] Simplify RemoveFilter --- .../grid/SortableFilterableBindingList.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/LibationWinForms/grid/SortableFilterableBindingList.cs b/Source/LibationWinForms/grid/SortableFilterableBindingList.cs index a5a5debb..a5aab5ca 100644 --- a/Source/LibationWinForms/grid/SortableFilterableBindingList.cs +++ b/Source/LibationWinForms/grid/SortableFilterableBindingList.cs @@ -9,7 +9,7 @@ namespace LibationWinForms { /* * Allows filtering of the underlying SortableBindingList - * by implementing IBindingListView aud using SearchEngineCommands + * by implementing IBindingListView and using SearchEngineCommands * * When filtering is applied, the filtered-out items are removed * from the base list and added to the private FilterRemoved list. @@ -93,12 +93,9 @@ namespace LibationWinForms public void RemoveFilter() { if (FilterString is null) return; - + for (int i = 0; i < FilterRemoved.Count; i++) - { - Items.Insert(i, FilterRemoved[i]); - base.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, i)); - } + Insert(i, FilterRemoved[i]); FilterRemoved.Clear();