Advertise with us

DataGridView blinks while refreshing using Windows C#

After refreshing datagridview, I lost focus on selected cells and random text blinks, Why? Please help me out!

My code: -

If I am trying to refresh various data in my datagridview, I lost my focus on selected cells and random text blinks. Why this happens? In other apps I don't see this problem, so I can fix this, but how? I refresh data by this

            SBind.DataSource = DTable;

            SBind.ResetBindings(false);

Last updated:10/16/2013 7:32:22 AM

1 Answers

C G E Mannerheim
C G E Mannerheim

You can Try this:

dataGridView1.SuspendLayout()

SBind.DataSource = DTable;

SBind.ResetBindings(false);

dataGridView1.ResumeLayout(true);

You can also try enabling the DoubleBuffered of your grid like this:

typeof(Control).GetProperty("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(dataGridView1, true, null);

Last updated:10/16/2013 7:32:22 AM

Answer