回 帖 发 新 帖 刷新版面

主题:[原创]dataGrid刷新求救

[em10][color=FF0000][/color]
CurrencyManager cm = (CurrencyManager)this.dataGrid1.BindingContext【ScriptPoints];
ScriptPoints.Insert(0, new BindingObject(10, "", "", "", 0, "", "", 0, "", "", "", 0, "", ""));
int CountIt = ScriptPoints.Count - 1;//int CountIt = ScriptPoints.Count;//
ScriptPoints.RemoveRange(1, CountIt);
if (cm != null)
    cm.Refresh();
                                
为什么在执行cm.refresh()后报出错误“索引1出没有值” 希望大家帮忙

回复列表 (共1个回复)

沙发

refresh是重构组建
vb里面用这个刷新,C#里面不能
建议用table的acceptchanges

我来回复

您尚未登录,请登录后再回复。点此登录或注册