此代码需要15秒才能执行:
this.gridView1.Columns.AddRange(Coloms.ToArray());//the number of Coloms is big
我该怎么做才能加快速度?
答案 0 :(得分:2)
尝试禁用可视更新。
this.gridControl1.BeginUpdate();
this.gridView1.Columns.AddRange(Coloms.ToArray())
this.gridControl1.EndUpdate();
来自the documentation的解释:
调用BeginUpdate方法后,当前打开 视图已被锁定,并且不会反映对其进行的任何更改 外观设置。调用EndUpdate方法可以解锁并重绘 观点。