我怎么能在WPF ListView的刷新 [英] How I Can Refresh ListView in WPF

查看:1220
本文介绍了我怎么能在WPF ListView的刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WPF和逐一加入记录到listview.ItemsSource但
当所有的数据包括,所以我的数据会出现我想逐一添加它告诉我我的纪录
我用ListView.Item.Refresh(),但我以前不工作。

Hi I am using wpf and adding one by one record to the listview.ItemsSource but my data will appear when all data included so i want to added one by one it show me my record I used ListView.Item.Refresh() but it did't work.

有没有什么办法..

谢谢...

推荐答案

如果您仍然需要刷新在其他情况下你的ListView(让我们假设你需要更新一次后的所有元素被添加到的ItemsSource)所以你应该使用这种方法:

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();

这篇关于我怎么能在WPF ListView的刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆