Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I'm developing a WPF app, in which i have a main wpf form with List View and a button to open a Popup which intern having two text fields with Add button. Once I click the Add button, thew two txts will be added to a xml file on my local system and the popup will be closed after that. Now my requirement is that once the popup is closed, its parent main form ListView should be updated with the txt names which have been written to xml file.

Whenever I'm clicking the Add button the txt names have been added to the xml file and popup is closed automatically. But when the control goes back to the main form, the listView is not updates automatically. Please anyone help me on this.

Thanks in advance.

Bhaskar D.
Posted
Comments
Ziee-M 20-Oct-14 11:04am    
HI, try using ObservableCollection instead of list. normaly the view should update automatically once youuse this type instead of old list.
Member 10546781 21-Oct-14 5:54am    
Please paste your code if it is still not working with above comments.

Use ObservableCollection instead of generic list and implement INotifyPropertyChange.
Read below link for more information.
https://social.msdn.microsoft.com/forums/silverlight/en-US/b993e9a1-4b06-4018-ab14-cbe254e3c0a6/difference-between-list-and-observablecollection
 
Share this answer
 
v2
i think you could also manually refresh your items with: listView.Items.Refresh()
 
Share this answer
 

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