简体   繁体   English

每当计时事件发生时,如何在表单上的ListView中刷新数据?

[英]How do I Refresh Data inside the ListView on my form everytime the time ticker event occurs C#

I am currently stuck trying to get the Listview box to refresh to show updated balances. 我目前一直在尝试使Listview框刷新以显示更新的余额。 Would anyone know how I can refresh the listView box with all the data inside it every time the timeticker event occurs so that the balances get updated ? 有谁知道每次timeticker事件发生时如何刷新列表视图框内的所有数据,以便余额更新? I have tried listview.Refresh. 我已经尝试过listview.Refresh。 That doesnt work. 那行不通。

Thanks 谢谢

First of all, assuming you are not using databinding, learn a little bit about it as it seems most relevant in your simple case: DataBinding Tutorial 首先,假设您没有使用数据绑定,请学习一下它,因为它在您的简单案例中似乎最相关: DataBinding教程

Once you bind your ListView to the source, attach a handler ( Event Handler Tutorial ) for the timeticker and call Refresh() on the ListView inside your timeticker handler. 将ListView绑定到源代码后,为timeticker附加一个处理程序( Event Handler Tutorial ),并在timeticker处理程序内的ListView上调用Refresh()。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM