慢速DataGridView的数据源设置为数据表在C# [英] Slow to set DataGridView DataSource to DataTable in C#

查看:131
本文介绍了慢速DataGridView的数据源设置为数据表在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DataTable,完全填充,这是我想设置一个DataGridView:

I have a DataTable, fully populated, which I want to set to a DatagridView:

gdv.DataSource = dt;



然而,这是痛苦的缓慢。 DataTable的填充是非常快的,但上面只是这一行需要年龄。有没有什么办法可以加快这或在另一个线程中执行呢?

However, this is painfully slow. The filling of the DataTable is very quick, but just this one line above takes ages. Is there any way to speed this up or perform it in another thread?

有就是这个点之后没有互动。正上方!简单的声明

There is no interaction after this point. Just the simple statement above!

感谢。

推荐答案

检查格式化选项,尤其是填写 - 相关属性。调整列宽所有行涉及到大量的计算。

Check the formatting options, especially the Fill -related properties. Adjusting columnwidths for all rows involves a lot of calculation.

这篇关于慢速DataGridView的数据源设置为数据表在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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