Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

The new DataGridView is really slow. :( The old MSFlexGrid was super fast compared to it's new replacement. Is there a way how I could speed up the DataGridView or am I the only one experiencing this problem? Or is there an alternative?

 

PS: I'm using VB 2005 Express and I don't need the database features.

Posted
I'm using a DataGridView in a current project and I've noticed it's rather slow; fourenatly I'm only using it to help with development so it wont slow down the final release. I don't know of a good alternitive but if you find one please post for the rest of us!

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Posted
The new DataGridView is really slow. :( The old MSFlexGrid was super fast compared to it's new replacement. Is there a way how I could speed up the DataGridView or am I the only one experiencing this problem? Or is there an alternative?

 

PS: I'm using VB 2005 Express and I don't need the database features.

umm. .. are you using that bassackwards approach of loading the grid manually (like the morons at xtremeVBtalk suggest you use the flexgrids) or are you binding your collection to it?

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
umm. .. are you using that bassackwards approach of loading the grid manually (like the morons at xtremeVBtalk suggest you use the flexgrids) or are you binding your collection to it?

 

I'm not quite sure what you mean, but I'll try to answer:

 

1) I've simply placed a DataGridView to my form by dragging it from the toolbox.

 

2) I edited the columns on the designer (Properties -> Misc -> Columns)

 

3) And in the code I add rows like this:

DataGridView.Rows.Add("Aaaa", "Bbbbbb", "Ccccc")

 

4) Also the user can edit certain cells.

Posted
The new DataGridView is really slow. :( The old MSFlexGrid was super fast compared to it's new replacement. Is there a way how I could speed up the DataGridView or am I the only one experiencing this problem? Or is there an alternative?

 

PS: I'm using VB 2005 Express and I don't need the database features.

 

DataGridView uses GDI+ drawing engine and for this reason it's rather slow. Wait for video cards with built-in GDI+ accelerators or start using 3rd party grid controls.

Posted

Yes, it draws slowly. If you watch how many records it processes, it takes as long to do the first x (that show up on the form) as it takes to add the rest out of 'scrolling range' if you will.

 

I tried to use the DGV.DataSource = MyCollection; however, whenever I did this it would not properly display the data. Unfourenatly I cannot run any sequal on my data so I get everything and have to manually weed out what I don't want.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Posted

create a class to wrap your data - MyDataClass .

declare a BindingList(MyDataClass) - MyBindingList

 

load MyBindingList with instances of your class

Set the DataSource of the grid to MyBindingList

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

  • 2 years later...
Posted

Hello, I have the same problem too. DataGridView control is very slow when I load a lot of data. Where can I find a complete and detailed example making this:

 

create a class to wrap your data - MyDataClass.

declare a BindingList (MyDataClass) - MyBindingList

 

load MyBindingList with instances of your class

Set the DataSource of the grid to MyBindingList

 

In this way, i will be able to solve my problem of performance?

Posted

I use DGVs all the time and think they are just fine, speed wise.

 

Are you calling .BeginEdit() and .EndEdit() when loading lots of data records? If not, I can see why it's slow, as it's redrawing with every data row that's added.

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...