Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
5.00/5 (1 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:

C#
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?

TIA
Alder
Posted
Comments
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)



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