Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

WPF Binding – Changing property on one object in collection and all the objects are changing

When I change value of textbox or checkbox it changes in every line. Whats wrong?
Here is an examplу: All checkboxes aren’t checked. I click on one of them and all the other are now checked.

enter image description here

Here is the code:
enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

Adding position method:
enter image description here

>Solution :

The problem is because of the below line

spotPosition = AutoTradingPositions.Where(position => 
                          position.PositionNumber == latestPositionNumber).First();

Where you are getting the same instance (first item in the collection) and adding the same as other items to the collection.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading