为什么删除不了指定行
别人相同的代码可以正常实现功能,即选择哪一行点删除就删除哪一行。
我这里的情况是选择哪一行点删除都是删除最后一行。是不是有什么东西锁住行了?用的gird风格
有人遇到过这种问题吗,求解决方法
下面是涉及到删除的代码
pfc_deleterow()里面
long ll_row
ll_row = dw_entry.GetRow()
dw_entry.DeleteRow(ll_row)
return ll_row
ue_bfupdate()里面
if li_rtn = 1 then
setnull(ls_delidno)
For ll_delrow = 1 To dw_entry.deletedcount()
ls_delstcode = dw_entry.GetItemString( ll_delrow,'xf_staffcode',delete!,true)
if ll_delrow > 0 then
Update xf_staff Set xf_idno = :ls_idno
Where xf_staffcode = :ls_delstcode
Using itrans_Current;
dw_entry.SetItemStatus(ll_delrow, 0 , Primary!,NotModified!)
end if
Next
end if
重点是相同的代码,别人做的可以实现,我实现不了
[解决办法]
ll_row = dw_entry.GetRow()
这个地方有时不太好用,点不准, 一般是这样改进, ll_row 设置为本地变量
在 clicked 下写
if row>0 then
ll_row=row
else
ll_row=0
end if
删除前 if ll_row>0 then
..........
end if
这样搞比较保险...............