Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All

I have two UI "A" and "B" in WPF. There is Drop Down list is there in "B" with say 10 records in which i have selected 5th record. Now if i add or edit some records from "A", the drop down in "B" is automatically changing to first value in the list and whatever i selected is not appeared in "B".

Records added from database to observable Collection list say "ItemList" in application "B" whenever added or updated from application "A" and there is property called "selectedRecord" is resetting value to first record in the list when added from "A" overwriting existing one in "B".

NotifyPropertyChanged("this",ItemList) and NotifyPropertyChanged("this",SelectedRecord) are used for notifying the changes

My question here is, when i added/updated data from "A", it should be available in the drop down list of application "B", but it should not be resetted to first value in the observable collection list.

To make it understand, drop down should have the selected record after editing the record.

Thanks and Regards
Venkat
Posted
Comments
Mahindra Shambharkar 20-Jul-15 5:38am    
As far as i understood your problem,
simple solution is updating private field of observation collection or adding items to collection rather than assigning new object to collection.
I think you are facing issue of reset in selected value is because altogether new object is assigned to Dropdowns itemsource rather than updating it by adding new items to collections.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900