Click here to Skip to main content
11,704,315 members (45,386 online)
Click here to Skip to main content

Tagged as

Reducing flicker, blinking in DataGridView

, 23 May 2012 CPOL 23.5K 23
Rate this:
Please Sign up or sign in to vote.
Reducing flicker and blinking in DataGridView.

Introduction

One of my project requirement was to create a Output Window similar to Visual Studio. For that I used a DataGridView. But when I start my application, I found that there is lot of blinking, flicker, pulling... After badly hitting my head with Google, I found a very easy way. We just need to create a extension method to DataGridView and it's all done:

public static void DoubleBuffered(this DataGridView dgv, bool setting) 
{ 
    Type dgvType = dgv.GetType(); 
    PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", 
          BindingFlags.Instance | BindingFlags.NonPublic); 
    pi.SetValue(dgv, setting, null); 
}

License

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

Share

About the Author


You may also be interested in...

Comments and Discussions

 
QuestionThank you. That was very useful! Pin
Dreamer9329-Jul-15 23:30
memberDreamer9329-Jul-15 23:30 
QuestionThank you Pin
Manuel Serrano Rojas19-May-14 2:38
memberManuel Serrano Rojas19-May-14 2:38 
AnswerRe: Thank you Pin
Shweta Lodha3-Jun-14 8:05
memberShweta Lodha3-Jun-14 8:05 
AnswerRe: Thank you Pin
Shweta Lodha16-Jun-14 2:13
memberShweta Lodha16-Jun-14 2:13 
GeneralMany thanks! Pin
gmax7518-Mar-14 13:31
membergmax7518-Mar-14 13:31 
GeneralRe: Many thanks! Pin
Shweta Lodha28-Mar-14 16:28
memberShweta Lodha28-Mar-14 16:28 
GeneralThanks! Pin
Luís Fernando Quitaiski22-Oct-13 2:03
memberLuís Fernando Quitaiski22-Oct-13 2:03 
GeneralRe: Thanks! Pin
Shweta Lodha24-Oct-13 7:30
memberShweta Lodha24-Oct-13 7:30 
QuestionSolved my problem Pin
Soji Omiwade29-Aug-13 17:22
memberSoji Omiwade29-Aug-13 17:22 
AnswerRe: Solved my problem Pin
Shweta Lodha29-Aug-13 22:12
memberShweta Lodha29-Aug-13 22:12 
QuestionHow to use? Pin
olssoninc20-Aug-13 21:04
memberolssoninc20-Aug-13 21:04 
QuestionSovled my flickering issues Pin
HHuysamen15-Aug-13 1:37
memberHHuysamen15-Aug-13 1:37 
AnswerRe: Sovled my flickering issues Pin
Shweta Lodha15-Aug-13 4:09
memberShweta Lodha15-Aug-13 4:09 
GeneralMy vote of 5 Pin
HHuysamen15-Aug-13 1:36
memberHHuysamen15-Aug-13 1:36 
QuestionVote of 5 Pin
zeeshan dar2-Jul-13 0:36
memberzeeshan dar2-Jul-13 0:36 
AnswerRe: Vote of 5 Pin
Shweta Lodha4-Aug-13 2:21
memberShweta Lodha4-Aug-13 2:21 
GeneralMy vote of 1 Pin
sandyellow29-Nov-12 19:36
membersandyellow29-Nov-12 19:36 
GeneralMy vote of 5 Pin
Shantoh22-Sep-12 6:19
memberShantoh22-Sep-12 6:19 
GeneralRe: My vote of 5 Pin
Shweta Lodha15-Aug-13 4:09
memberShweta Lodha15-Aug-13 4:09 
GeneralMy vote of 5 Pin
honeysinghi23-May-12 17:11
memberhoneysinghi23-May-12 17:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150819.1 | Last Updated 23 May 2012
Article Copyright 2012 by Shweta Lodha
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid