public void SetProperities()
{
Type dgvType = dataGridView1.GetType();
PropertyInfo pi = dataGridView1.GetProperty("DoubleBuffered",
BindingFlags.Instance | BindingFlags.NonPublic);
pi.SetValue(dgvApps, true, null);
}
public fromshow(){
InitializeComponent();
//为 DataGridView 设置DoubleBuffered 设置双缓存属性。这样就Datasource 属性 DataGridView变化时cell内的控件就不会闪烁了。其中用了反射原理。因为这个属性是control的protected 属性无法通过DataGridView控件直接赋值。
SetProperities();
}