2009-07-10 26 views

回答

4

您應該使用ObervableCollection。當這個集合被更新時,ListView被更新。

但如果你鴕鳥政策任何理由要使用一個,使用:

listView.InvalidateProperty(ListView.ItemsSourceProperty); 

listView.ItemsSource = listView.ItemsSource; 

檢查A more elegant ListView requery獲取更多信息。

-1

ListView.DataBind(); MSDN

+0

這是我嘗試的第一件事情之一。 您的答案引用System.Web.UI.WebControls ListView,但WPF ListView是System.Windows.Controls.ListView。 – KevinDeus 2009-07-10 21:35:15

1

嗯......

listView.ItemsSource = listView.ItemsSource? 

,或者你可以觸發你的視圖模型中使用的是MVVM情況下屬性的PropertyChanged事件。

相關問題