Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7764583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:56:57+00:00 2026-06-01T14:56:57+00:00

I have a strange behavior with my WPF ListView Control. ListViews ItemSource is Observable

  • 0

I have a strange behavior with my WPF ListView Control.
ListViews ItemSource is Observable collection.the ItemSource is updated periodically.
When I’m selecting one of the item and then selecting other item and no item updated, everything is OK.
But when I’m selecting an item witch is updated while I’m standing on, then selecting other item, now I have two items selected instead of one.
When I’m looking with the debugger, I see the event args of SelectionChanged event. I see that added item is OK but no removed item.
Anyone knows what’s the problem?
Thanks!

Edit:

My observable collection:

    protected class CustomObservableCollection : ObservableCollection<T>
    {
        public void Refresh()
        {
            ListCollectionView lcv = (ListCollectionView)(CollectionViewSource.GetDefaultView(this));
            lcv.Refresh();
        }
    }

The update method witch called when there is a change in some item:

    public void RefreshItem(T domainObject)
    {
        foreach (T item in obsCollection) {
            if (!DomainObjectComparer.Equals(domainObject, item)) continue;
            DomainObjectCopier.CopyProperties(domainObject, item);
            obsCollection.Refresh();
            break;
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:56:58+00:00Added an answer on June 1, 2026 at 2:56 pm

    Well, Apparently the problem was with the overridden GetHashCode() method of the ListView item object.
    the hash code included all the fields in it’s calculation. I remoed all the fields (properties) and now the overridden GetHashCode() is only calculating the hash based on item’s ID. it solved the problem.
    I also have Equals() method overridden.
    If someone knows why it is related I will like to know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scenario which is causing strange behavior with WPF data binding and
I have found strange behavior of IEnumerable. When i create a collection using Linq
I am using FileWriter and I have noticed strange behavior. I buffer my collection
Currently i have a strange behavior in my WPF Application. I have a Main
SPListItem.GetFormattedValue seems to have a strange behavior for DateTime fields. It retrieves the DateTime
I have encountered a strange behavior while executing an sql query on the Oracle
I have a very strange behavior with Request.Form . Here are two IIS 7
I have a really strange behavior with highchart (via rails plugin): The graph display
I have a simple HTML (as HTA) application that shows strange behavior on Windows
I have a horizontal animated menu that has a strange behavior because it works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.