本文介绍了如何每隔1分钟自动刷新WPF上的Datagrid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要能够刷新我的数据网格,因为我正在更新我的数据库datagrid上的表,并希望看到网格中的更改,有没有办法每1分钟自动更新datagrid?解决方案
DataGrid.Items.Refresh()
将刷新项目。然后,您可以使用运行每一分钟强制刷新
是一个实现定时器来更新ListBox的例子,您可以根据自己的目的进行调整。
I want to be able do refresh my datagrid, because I am updating my table on my database datagrid and want to see the changes in grid , is there any way of automatically updating datagrid for every 1 minute?
解决方案
DataGrid.Items.Refresh()
will refresh the items. You can then use a timer to run every minute to force the refresh
Here is an example of implementing a timer to update a ListBox which you can adapt for your purpose.
这篇关于如何每隔1分钟自动刷新WPF上的Datagrid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!