Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataGridView RowCount setting very slow
Message
From
28/10/2008 06:23:08
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01357256
Message ID:
01357609
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform