I'm rewriting its XML itemSource on the fly and want it to use the new data right away...
That was one of the first things I tried. Your answer refers to a System.Web.UI.WebControls ListView, but the WPF ListView is System.Windows.Controls.ListView.
KevinDeus
2009-07-10 21:35:15
A:
hmm...
listView.ItemsSource = listView.ItemsSource?
or you could trigger the PropertyChanged event on the property of your viewmodel in case you are using MVVM.
Botz3000
2009-07-13 16:48:08
+1
A:
You should use an ObervableCollection. When this collection is updated, the ListView is updated.
But if for any reason you don´t want to use one, use:
listView.InvalidateProperty(ListView.ItemsSourceProperty);
or
listView.ItemsSource = listView.ItemsSource;
Check http://stackoverflow.com/questions/1406542/a-more-elegant-listview-requery for more info.
cad
2010-03-31 18:45:01