Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataGridView RowCount setting very slow
Message
De
28/10/2008 06:23:08
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01357256
Message ID:
01357609
Vues:
15
David,

>You expect the creation of 108 million objects to be fast?
> How many gb of ram get consumed by that operation?

Your question is based on the wrong assumtotions.
DataGridView VirtualMode is designed to *show* one screenful from large *virtual* data efficiently.
OnCellValueNeeded is called whenever data is required.
RowCount assignment line does *not* create day objects.

Task Manager shows that this code does not require any measurable about of RAM if running.
Here is better samle to reproduce this issue:

using System;
using System.Windows.Forms;

class Test
{
public static void Main()
{
Application.Run(new VirtualModeForm());
}
}

class VirtualModeForm : Form
{
DataGridView grid = new DataGridView();
public VirtualModeForm()
{
Controls.Add(grid);
grid.VirtualMode = true;
grid.ColumnCount = 108;
// this line causes 8 seconds delay. how to fix.
grid.RowCount = 1000000;
}
}
Andrus
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform