Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
AnswerRe: Speeding up DataGridView RowCount assignment Pin
Wendelius27-Oct-08 10:23
mentorWendelius27-Oct-08 10:23 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
AndrusM27-Oct-08 10:28
AndrusM27-Oct-08 10:28 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
Wendelius27-Oct-08 10:49
mentorWendelius27-Oct-08 10:49 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
AndrusM27-Oct-08 23:53
AndrusM27-Oct-08 23:53 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
Luc Pattyn27-Oct-08 10:33
sitebuilderLuc Pattyn27-Oct-08 10:33 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
AndrusM27-Oct-08 22:58
AndrusM27-Oct-08 22:58 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
Luc Pattyn27-Oct-08 23:28
sitebuilderLuc Pattyn27-Oct-08 23:28 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
AndrusM28-Oct-08 0:09
AndrusM28-Oct-08 0:09 
Luc,

Thank you. MSDN has DataGridView_Samples.zip which contains two VirtualMode grid samples and a doc file covering VirtualMode a bit.
Part of samples from this file are also duplicated in MSDN doc code samples.
MSDN forums contains also some few messages about VirtualMode.
There is also a Chris Cells book. The sample code presented here is modified sample from this book.
My code is based on this information.

I have looked first 100 pages returned from google search.
I havent found any other information about DataGridView VirtualMode.

Pressing F11 in RowCount moves to next line after delay. So OnCellValueNeeded method not any other lines in my code are not called.

In real application I have wide Product tables which can contain 100 columns. They appear fine in wide LCD screen. Reducing number of columns to 50 causes also long delay.

I'm sorry for a bad sample. Below is minimal code to reproduce
8 sec delay 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.
        grid.RowCount = 1000000;
    }
}


Andrus

GeneralRe: Speeding up DataGridView RowCount assignment Pin
Luc Pattyn28-Oct-08 0:31
sitebuilderLuc Pattyn28-Oct-08 0:31 
GeneralRe: Speeding up DataGridView RowCount assignment Pin
AndrusM28-Oct-08 3:30
AndrusM28-Oct-08 3:30 
Questionhow to make call to telephone in c# Pin
ramu20u27-Oct-08 9:21
ramu20u27-Oct-08 9:21 
AnswerRe: how to make call to telephone in c# Pin
MidwestLimey27-Oct-08 9:38
professionalMidwestLimey27-Oct-08 9:38 
AnswerRe: how to make call to telephone in c# Pin
PIEBALDconsult27-Oct-08 18:20
mvePIEBALDconsult27-Oct-08 18:20 
Questionproblem with creating a messagequeue Pin
prasadbuddhika27-Oct-08 9:10
prasadbuddhika27-Oct-08 9:10 
AnswerRe: problem with creating a messagequeue Pin
manfred.bjorlin27-Oct-08 9:14
manfred.bjorlin27-Oct-08 9:14 
QuestionProblems with deserialization of MessageQueue Message Pin
manfred.bjorlin27-Oct-08 9:04
manfred.bjorlin27-Oct-08 9:04 
AnswerRe: Problems with deserialization of MessageQueue Message Pin
Le centriste27-Oct-08 9:33
Le centriste27-Oct-08 9:33 
GeneralRe: Problems with deserialization of MessageQueue Message Pin
manfred.bjorlin28-Oct-08 0:01
manfred.bjorlin28-Oct-08 0:01 
GeneralRe: Problems with deserialization of MessageQueue Message Pin
Le centriste28-Oct-08 2:19
Le centriste28-Oct-08 2:19 
GeneralRe: Problems with deserialization of MessageQueue Message Pin
manfred.bjorlin28-Oct-08 2:29
manfred.bjorlin28-Oct-08 2:29 
QuestionBuilding a FAT emulator Pin
Gianpaolo Barci27-Oct-08 7:23
Gianpaolo Barci27-Oct-08 7:23 
AnswerRe: Building a FAT emulator Pin
Michael Bookatz27-Oct-08 7:32
Michael Bookatz27-Oct-08 7:32 
GeneralRe: Building a FAT emulator Pin
Gianpaolo Barci27-Oct-08 7:48
Gianpaolo Barci27-Oct-08 7:48 
GeneralRe: Building a FAT emulator Pin
User 665827-Oct-08 11:33
User 665827-Oct-08 11:33 
QuestionDeleting Items and Selecting next one on ListBox on C# Pin
three.leaf27-Oct-08 6:33
three.leaf27-Oct-08 6:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.