Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've got a WinForms application written in C# using .net 2.0. The application loads data from a database into custom objects and are housed usually in a BindingList<t> object but sometimes just a List<t> object. The list objects are then bound to DataGridView WinForms controls. Under XP, the data binding is relatively quick, even with a list containing several thousand objects. In Windows 7 however, it takes considerably longer to bind data to DataGridView controls. The performance difference really starts to show when dealing with a list that is holding several hundred objects and gets noticeably much worse the larger the data set gets.

What gives? I know there are major changes to the graphics systems between XP and Windows 7, especially in regards to GDI+ and hardware acceleration. Could this be the cause of the serious performance drops I see when running this WinForms application under Windows 7?

Thanks.
Posted

i am using win7, binding DGV to a binding source which is populated back to database queries, with thousands of rows of data and see no significant issue with performance.

Things to watch for; I optimised my code and got about about a 2-5x improvement just by tweaking how the column size etc was done during loading of the data.


i would not expect a significant change in performance for the same app with XP v Win7
 
Share this answer
 
I dont know if this will help you, but if your Windows is 64bits and your problem have something whit that, you can configure your application to work in compatibility whit 64, to do so, go to "Project", up in your studio, and choose the properties, then go to "compile" option (second option from up to below) an change Any CPU to x86.

Obs.: My visual studio is in other language so sorry if I wrote some wrong option, but I gave you the location.

Hope this help.
 
Share this answer
 
Some things of note:

1. Doing a form refresh in W7 is considerably slower than XP; this may also be true of the refresh on individual controls, make sure you're not refreshing the control/form unnecessarily.

2. It's good practice to kill the paint operations on your grid prior to loading it (SuspendLayout), and then immediately following the load, force a paint (PerformLayout).

3. Consider using the Virtual mode of the DataGridView to improve performance.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900