帮看看这个数据窗口问题!
在一个grid风格的数据窗口中表如下:
BH XM CJ
005 张三 90
001 李四 86
006 王二 79
008 刘五 92
我想实现如下功能:
在编辑各行时如果当前行转移到另一行并且BH列为空时就删除这一行。我在数据窗口控件的rowfocuschanging()事件中写了如下代码:
string ls_xm
if currentrow<>0 then
this.SetRedraw(False)
ls_xm=this.object.xm[currentrow]
if isnull(ls_xm) or len(trim(ls_xm))=0 then
this.deleterow(currentrow)
end if
this.SetRedraw(true)
end if
在使用中如果我把光标向上移动就能正常删除下面行中xm为空的行,可是向下移动时删除xm为空的行时就会出错。帮看看怎么做才能正常。