填充未绑定DataGridView的最快方法 [英] Quickest Way to Populate an Unbound DataGridView

查看:72
本文介绍了填充未绑定DataGridView的最快方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我一直以编程方式填充DataGridView,但因为它正在加载大约。超过60列的4500条记录需要花费很长时间才能加载。



我看着将存储信息的DataTable绑定到DataGridView并且它填充了很多更快,但不允许我更改DataGridView,如隐藏某些列或行或更改某些单元格中的文本颜色。



什么是最快的和使用我的DataTable中的所有数据填充DataGridView的最有效方法,但仍然让我可以在不影响DataTable的情况下操作DataGridView吗?



谢谢

解决方案

请参阅我对该问题的评论。用这个数据量快速填充它的整个想法是错误的。如此多的记录无法同时查看,没有人需要全部查看。您可以使用不同的方法仅显示用户真正需要查看的部分数据。可以响应于仅请求某些数据子集的某些查询来呈现数据。此外,您可以在虚拟模式下实现分页。然后你可以从这里开始:

https: //msdn.microsoft.com/en-US/library/ms171622%28v=vs.80%29.aspx [ ^ ]。



-SA

Hi all,

I have been populating a DataGridView programatically but as it's loading approx. 4500 records over 60 columns it's taking quite a while to load.

I looked at binding the DataTable, where my information is stored, to the DataGridView and it populates it much faster but then doesn't allow me to make changes to the DataGridView such as hiding certain columns or rows or changing text colour in certain cells.

What is the quickest and most efficient way of populating the DataGridView with all the data from my DataTable but still leave me access to manipulate the DataGridView afterwards without affecting the DataTable?

Thanks

解决方案

Please see my comment to the question. The whole idea to populate it fast with this volume of data is wrong. So many records cannot be viewed at the same time, and no one needs to see them all. You can use different approaches to show only part of data which the user really needs to see. The data could be presented in response to some query requesting only some subset of data. Also, you can implement paging in virtual mode. Then you can start here:
https://msdn.microsoft.com/en-US/library/ms171622%28v=vs.80%29.aspx[^].

—SA


这篇关于填充未绑定DataGridView的最快方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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