If I refresh some data in my datagridview, I lose my focus on selected cells and random text blinks.
Why does this happen? In other apps I don't see this problem, so I can fix this, but how?
I refresh data by this code:
SBind.DataSource = DTable; // SBind is binded my grid.DataSource = SBind
SBind.ResetBindings(false);
Try this:
SBind.SuspendLayout();
SBind.DataSource = DTable;
SBind.ResetBindings(false);
SBind.ResumeLayout(true);
You can also try enabling the DoubleBuffered
of your grid like this:
typeof(Control).GetProperty("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance)
.SetValue(SBind, true, null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With