DATAGRIDVIEW BLINKS WHILE REFRESHING USING WINDOWS C#

Lady Bird Johnson

Total Post:20

Points:140
Posted by  Lady Bird Johnson
C# 
C#
 4692  View(s)
Ratings:
Rate this:
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);

  1. C G E Mannerheim

    Post:29

    Points:203
    Re: DataGridView blinks while refreshing using Windows C#

    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);

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!