[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

DataGridView Performance Improvements

JelaniClark

10/24/2008 7:09:00 AM

Hi All,

I just wanted to share a few things that dramatically improved the speed of my 15 column datagridview which held hundreds of records:

1) Set CellBorderStyle to None (provided the most noticeable Painting speed improvement). To make the rows in the DataGridView easier on the eyes I used the AlternatingRowsDefaultCellStyle.

2) In the Columns Collection, set the Columns' AutoSizeMode to None.


I hope this helps.

-jelani
1 Answer

Cowboy

10/24/2008 2:29:00 PM

0

The more you rely on the browser capabilities to paint (assuming a website
here), the better. This means you should try to use styles (CSS) rather than
use some of the shortcuts attached to the grid.

If you want to take this to the full extent, you will want to download the
CSS Friendly Control Adapters, which wrap the .NET controls to output pure
CSS. There is info here:
http://www.asp.net/Cs...

If you want to see a GridView in example, you can see it here:
http://www.asp.net/CSSAdapters/Gri...

The actual source is on CodePlex:
http://www.codeplex.com/c...

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/Greg...

or just read it:
http://feeds.feedburner.com/Gre...

********************************************
| Think outside the box! |
********************************************
<Jelani Clark> wrote in message news:200810243918jelani100@hotmail.com...
> Hi All,
>
> I just wanted to share a few things that dramatically improved the speed
> of my 15 column datagridview which held hundreds of records:
>
> 1) Set CellBorderStyle to None (provided the most noticeable Painting
> speed improvement). To make the rows in the DataGridView easier on the
> eyes I used the AlternatingRowsDefaultCellStyle.
>
> 2) In the Columns Collection, set the Columns' AutoSizeMode to None.
>
>
> I hope this helps.
>
> -jelani