问题描述
我使用的BindingSource控制,以填充DataGridView控件。大约有1000个以上的记录填充它。我使用线程这样做。 DataGridView的执行在这种情况下很慢。
I am using a BindingSource control to populate datagridview control. There are around 1000+ records populating on it. I am using threading to do so. The datagridview performs very slow in this case.
我试图DoubleBuffered属性设置为true,RowHeadersWidthSizeMode禁用,AutoSizeColumnsMode无法比拟的。但是还是一样的行为。
I tried to set DoubleBuffered property to true, RowHeadersWidthSizeMode to disabled, AutoSizeColumnsMode to none. But still the same behavior.
请帮我在这。事先我怎么能提高电网的性能。
Please assist me in this. How can I improve the performance of the Grid.
谢谢,
结果维杰 -
Thanks in advance,
Vijay
推荐答案
如果你有一个巨大的行量,像10 000多,
If you have a huge amount of rows, like 10 000 and more,
要避免性能泄漏 - 执行以下操作数据绑定之前:
to avoid performance leak - do the following before data binding:
dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing; //or even better .DisableResizing. Most time consumption enum is DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders
// set it to false if not needed
dataGridView1.RowHeadersVisible = false;
在数据绑定您可以启用它。
after data binded you may enable it.
这篇关于在大数据填充的DataGridView性能下降的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!