以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  chuanhuo1表的yihuishoujin不能触发datachenged事件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=73520)

--  作者:jinzhengbe
--  发布时间:2015/8/20 15:58:00
--  chuanhuo1表的yihuishoujin不能触发datachenged事件


chuanhuo1表的yihuishoujin不能触发datachenged事件

输入数据后yihuishounum也没用变化,不知道啥原因,请帮忙看看!!

[此贴子已经被作者于2015/8/20 17:20:40编辑过]

--  作者:大红袍
--  发布时间:2015/8/20 16:08:00
--  

1、测试没有问题,修改肯定会触发事件。

 

2、不万不得已不要写 SystemReady = False 这样的代码


--  作者:大红袍
--  发布时间:2015/8/20 16:11:00
--  

正确代码

 

If e.DataCol.name ="yihuishounum"
    Dim  pr As  DataRow = e.DataRow.GetParentRow("chuanhuo2")  \'找出对应的父行
    If  pr IsNot Nothing Then
        DataTables("chuanhuo2").DataCols("tuinum").RaiseDataColChanged(pr)   \'通知系统此父行的数量列发生了改变,触发DataColChanged事件
       
        e.DataRow("yihuishoujin")=0
        e.DataRow("huitime") =Date.now()
        e.DataRow("zhiyuan2") =user.name
    End If
Else If e.DataCol.name ="yihuishoujin"
    e.DataRow("yihuishounum")= e.DataRow("yihuishoujin") / e.DataRow("price")
    e.DataRow("huitime") =Date.now()
    e.DataRow("zhiyuan2") =user.name
End If


--  作者:jinzhengbe
--  发布时间:2015/8/20 17:33:00
--  

非常感谢~~~