473,396 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Fast creation for huge DataGridView?

M R
I need to build and display a huge data grid (roughly 5000x5000). (I know it
is difficult to view, but i need to do it anyway)

the immediate problem i am facing is that it takes a VERY long time to add
5000 columns. i created an array of DataGridViewTextBoxColumn[] and called
DataGridView Columns.AddRange(array). This still takes a VERY long time. i
haven't even attempted to add the 5000 rows or calculate the values of each
cell (25M of them)

is there a trick that i am overlooking on how to manage this?

But there must be a better way. it makes more sense to display the headers
and rows and calculate the value of the cells as they become visible rather
doing the whole thing up front. is there a way to do this? or do i need to
use a third party product?

thanks
m
Sep 17 '07 #1
2 2888
Are you databinding this huge array in some way? Perhaps a virtual grid
approach may be more useful.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"M R" <mo********@zoomix.comwrote in message
news:O9****************@TK2MSFTNGP02.phx.gbl...
>I need to build and display a huge data grid (roughly 5000x5000). (I know
it is difficult to view, but i need to do it anyway)

the immediate problem i am facing is that it takes a VERY long time to add
5000 columns. i created an array of DataGridViewTextBoxColumn[] and called
DataGridView Columns.AddRange(array). This still takes a VERY long time. i
haven't even attempted to add the 5000 rows or calculate the values of
each cell (25M of them)

is there a trick that i am overlooking on how to manage this?

But there must be a better way. it makes more sense to display the headers
and rows and calculate the value of the cells as they become visible
rather doing the whole thing up front. is there a way to do this? or do i
need to use a third party product?

thanks
m
Sep 17 '07 #2
>I need to build and display a huge data grid (roughly 5000x5000). (I know
>it is difficult to view, but i need to do it anyway)

the immediate problem i am facing is that it takes a VERY long time to add
5000 columns. i created an array of DataGridViewTextBoxColumn[] and called
DataGridView Columns.AddRange(array). This still takes a VERY long time. i
haven't even attempted to add the 5000 rows or calculate the values of
each cell (25M of them)

is there a trick that i am overlooking on how to manage this?

But there must be a better way. it makes more sense to display the headers
and rows and calculate the value of the cells as they become visible
rather doing the whole thing up front. is there a way to do this? or do i
need to use a third party product?
The number of columns you're dealing with is completely unreasonable IMO (do
you really "need" to do it) but in any case, you can check out its
"VirtualMode" property though it doesn't address the number of columns
(which you should handle dynamically anyway). IMO however, you may wish to
consider a 3rd-party product instead. I normally hate to resort to this
since I generally distrust most products on the market outside of MSFT.
However, the "DataGridView" has been an enormous source of problems for me
personally after more than a year of very intense work with it (and a lot of
research into improving its performance - note that even one MSFT blogger
acknowledged the problem based on the use of slower API functions compared
to the older "DataGrid" control - perhaps you should check that control out
instead though I've never used it myself). In any case, the performance can
be very, very poor as you've now discovered (depending on various factors)
but moreover, there are some (potentially) difficult programming issues with
the control in general depending on what you're up to (which I won't get
into here). MSFT no doubt spent a lot of time designing this control and it
certainly shows. It has a lot of power and flexibility but there are still
some serious issues that need to be worked out IMO (performance being a
major one).
Sep 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DraguVaso | last post by:
Hi, I'm using the DataGridView in VB.NET 2.0. The DataSource is a Generic List of a custom class0: lstMyPersonnes = New List(Of clsPersonne). When I add a new clsPersonne to lstMyPersonnes,...
13
by: William Stacey | last post by:
FYI. /// <summary> /// Author: William Stacey /// Fast and simple way to implement a singleton pattern without resorting /// to nested classes or other static vodo. Can also be easily converted...
6
by: dbuchanan | last post by:
Hello, Is this a bug? Is there some kind of work around? I want to add default values for a few columns in my datagridview I found the "DefaultValuesNeeded" event for the datagridview I...
14
by: google | last post by:
I am creating a new database for use within our company, that I'd like to make reasonably secure (short of a true server based solution). The back-end of a non-server based database seems to be...
7
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's...
13
by: Arno R | last post by:
Hi all, I am deploying an A2k app to users with different versions of Access. Using Access 2000 the relinking on startup (on deploying a new frontend or when backend has changed) is very fast....
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
0
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by...
3
by: vikas000000a | last post by:
Hi All, I am new to this forum as far as posting a question is concerned, although I have quite frequently visiting this site as a guest. My quertion relates to preforming fast searched in a very...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.