Click here to Skip to main content
11,803,019 members (75,425 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
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 at 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
0 KrunalRohit 356
1 OriginalGriff 335
2 CPallini 270
3 F-ES Sitecore 270
4 Sergey Alexandrovich Kryukov 234
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,735
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2015
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