Duplicate items when setting ModelFilter
ObjectListView - ListView on caffeine, guarana and steroids
Brought to you by:
grammarian
Hi Phillip, I found a possible issue, I have a list of objects which display fine on the grid, if I apply a model filter to the grid then a few items on the grid will appear twice, if I check the list size I can confirm that it contains the correct amount of items, but more items get rendered on the grid, if I remove the ModelFilter the grid keeps displaying double items.
Here's how I set the filter:
lstTasks.ModelFilter = new ModelFilter(delegate (object modelObject) { return VisibleObjectIds.Contains(((TaskObject)modelObject).Id); });
and how I clear it:
lnkClearFilter.Hide(); lstTasks.ModelFilter = new ModelFilter(delegate (object modelObject) { return true; });
When I load the list initially it is perfect, the duplicates will appear only after appying a filter and won't go away after clearing it.
Thank you
In fact any filter duplicates some of the items, like this:
What type of ObjectListView are you using?
On Thu., 20 Dec. 2018, 4:01 am Paul. F <paul-f@users.sourceforge.net wrote:
Related
Support Requests: #18
Hi Phillip, it's C# Winforms, I could confirm that applying just about any filter to the model filter will make some duplicate items appear while the collection size remains the same.
My objects are very simple, contained in a List<taskobject>:</taskobject>
Actually if I setup a clean test project I don't get the same problem so the issue must lie somewhere in my code.