以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  求助DataColChanging遇到的一个问题!  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=62101)

--  作者:Bin
--  发布时间:2014/12/25 14:33:00
--  
修改了合并列,相当于修改了所有合并在一起的列,  这个肯定会触发多次的.
--  作者:Bin
--  发布时间:2014/12/25 14:35:00
--  
换个方式去做吧,设置一个修改窗口,在窗口中修改. 然后代码写到窗口事件里去.
--  作者:有点甜
--  发布时间:2014/12/25 14:38:00
--  
static pval As String = ""
If e.DataCol.Name = "列A" Then
    If e.DataRow.IsNull("列A") = False Then
        If pval <> e.newvalue Then
            Dim ro As DataRow = DataTables("表A").SQLFind("列A = \'" & e.NewValue & "\'")
            If ro Is Nothing Then
                MessageBox.Show("不存在该名称,请先添加!","提醒")
                pval = e.newvalue
                e.Cancel = True
                Return
            End If
        End If
    End If
End If