Click here to Skip to main content
13,002,000 members (79,570 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all, I've built a method to perform various operations on a DataGridView (disable columns, rename header columns, format cells ecc. ecc.).

The first time I use method with one DataGridView it works very quickly.

If I use the same method another time with the same DataGridView (for example to refresh it after some operations) it works much more slowly.

It takes very long time to perform operations I report below:

dgvCol.DefaultCellStyle.Format = string.Format(veroFormatoNumerico, System.Globalization.CultureInfo.InvariantCulture);
dgvCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
dgvCol.HeaderText = sVisualizza;

Why the first time I use them it takes short time and the second time it takes much more time? What should I do?

Posted 28-Jan-13 23:54pm
supernorb 30-Jan-13 18:06pm
I think it is still not clear about what you are trying to do and the detail of your code. I think many answerers in codeproject want to vote you down for questions like this, but I'm an exception. Don't want to vote down anything, anyone... =)) However if there are dozens of down vote, I will feel happy to add more one of myself to that thing.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170624.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100