Click here to Skip to main content
13,087,797 members (80,559 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

40.3K views
26 bookmarked
Posted 23 May 2012

Reducing flicker, blinking in DataGridView

, 23 May 2012
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...

Pro

Comments and Discussions

 
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    Praise Praise    Rant Rant    Admin Admin   

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

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