dgv.SetDoubleBuffered(dgv,
true
);
/// <summary>
/// 将给定的DataGridView设置双缓冲
/// </summary>
/// <param name="dgv">给定的DataGridView</param>
/// <param name="b">设置为ture即打开双缓冲</param>
public void SetDoubleBuffered(DataGridView dgv, bool b)
{
var dgvType = dgv.GetType();
var pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
pi.SetValue(dgv, b, null);
}