Today's Question:  What's your opinion about Alibaba mooncake incident?        GIVE A SHOUT

Technical Article => Programming =>  C#

Slow Datagridview... Oh No!

  Schalk      2012-02-07 07:12:26      3,322    0    0

So we all have been here, I had finished a project using VS2008, implementing  Datagridviews on litterally each and every form of the system. This had been a requirement from the onset as to ensure easy searching,navigation and capturing of data. So the data capture ladies start doing their thing and low and behold the dreaded call... they are unhappy with the speed of the DataGridView. I had to agree with them, the repaint of the and overall perfromance of the grid is awfull. So started a tedious process of trying to speed this up...

The first step was to look at my queries but they seemed fine. Not a lot I could do there.

I tried removing gridlines and embbed smaller images... really clutching at straws... could not get the speed up to acceptable levels.

All the while having users getting more and more irate with the performance.  

Here is what it looked like :

As you can see... a straight select of +-6000 rows got the grid choking to a repaint of more than 5 seconds!!

Anyway... after a lot of soul searching and delving deep a finally got to the solution. The same grid now loads/repaints in less than a second... here's what it looks like after my efforts


I wrote the solution into a DDL .. so just add the dll as a reference to your project like this.....


Then in your Form_Load event you just call  YourGridviewName.SpeedUpThisGridView(true);


and there you are.

This implemetation will sort out all your DataGridView speed issues. I wrote this in VS2008 and tested it in VS2010. Please note that this dll is only for Win APP's and not for Web or SilverLight

Works like a dream, with a lot of happy customers.

If you want a copy of this dll please email me at schalk@mineware.co.za and I will send it to you ASAP.

Source:http://rdatagridview.blogspot.com/

C# SOLUTION SLOW DATAGRIDVIEW

  SAVE AS PDF   MARK AS READ   MARK AS IMPORTANT

  RELATED


  0 COMMENT


No comment for this article.


  WRITE ARTICLE

Client brief vs client budget

By sonic0002
Sometimes plans are quite different from realities. This is true especially in IT induestries. Usually when a client starts to present their plan, they have a really great vision. However when comes to the budget, the client runs into difficult.