Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How I Can Refresh ListView in WPF

Tags:

listview

wpf

Hi I am using WPF and adding records one by one to the listview.ItemsSource. My data will appear when all the data is included, but I want to show the data as it is added one by one.

I used ListView.Item.Refresh() but it didn't work.

Is there any way?

like image 920
Jitendra Jadav Avatar asked Dec 20 '10 09:12

Jitendra Jadav


1 Answers

If you still need to refresh your ListView in any other case (lets assume that you need to update it ONE time after ALL the elements were added to the ItemsSource) so you should use this approach:

ICollectionView view = CollectionViewSource.GetDefaultView(ItemsSource); view.Refresh(); 
like image 86
Eugene Cheverda Avatar answered Sep 20 '22 01:09

Eugene Cheverda