C#DataGridView随着时间的推移而减速 [英] C# DataGridView Slows Down Over Time

查看:86
本文介绍了C#DataGridView随着时间的推移而减速的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的C#程序中有一个DataGridView。当程序加载时控件很快但全天控制变得越来越慢。用户必须退出程序并重新加载它以使控件再次运行得更快。


任何提高速度的提示?

I have a DataGridView in my C# program. When the program loads the control is fast but throughout the day the control becomes slower and slower. The user must exit the program and reload it for the control to run faster again.

Any tips for making this faster?

推荐答案

这看起来很奇怪,datagridview是否有机会链接到非常大量的数据?它可能只是开始只将它加载到内存中,但随着时间的推移,越来越多的大型chucnk开始使用,它会减缓筛选所有这一切?这就是所有的理论。


只是控制或整个程序看起来是否缓慢?整个电脑运行在哪?它可能你没有释放内存?
That seems strange, is the datagridview linked to a very large amount of data by any chance? It might start out only loading a bit of it to memory, but as the day goes on and more and more of that large chucnk becomes in use, it slows down sifting through it all? That''s all theory though.

Is it JUST that control or does the whole program seem sluggish? The whole computer its running on? Its possible you are not freeing up memory?


只有网格减慢。数据网格不受约束。我清除并根据用户指定的内容添加包含新信息的所有行。它甚至在我的机器上运行缓慢一段时间后它比它们的增强更多。
Only the grid slows down. The datagrid isn''t bound. I clear and the add all the rows with new information depending on what the user specifies. It even runs slow on my machine after awhile and it''s beefed up more than theirs.


嗯,另一个头部刮擦。

有很多与之相关的代码?也许我们可以看到它?

也许在重新填充时网格上的数据量没有完全消失有一些问题?



在更改DataGridView上的内容后,尝试引入GC.Collect()并查看它是否有帮助?
Hmm, another head scratcher.
Is there a lot of code associated with it? Maybe we could see it?
Perhaps there''s some issue with the previous amount of data on the grid not getting completely wiped out when you re-populate?


Try throwing in a GC.Collect() after you change what''s on the DataGridView and see if it helps things at all?


这篇关于C#DataGridView随着时间的推移而减速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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