以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 禁止编辑不起作用 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=18551) |
||||
-- 作者:lsfdf -- 发布时间:2012/4/17 11:10:00 -- 禁止编辑不起作用 禁止编辑不起作用是 Select Case e.DataCol.Name Case "发货确认" Dim dt As DataTable = DataTables("产品表") Dim drs As List(Of DataRow) \'定义一个DataRow集合. drs = dt.Select("编码 = \'" & e.DataRow("编码") & "\'and 批次 = \'" & e.DataRow("批次") & "\'") If drs.Count = 0 Then If e.DataCol.Name = "发货确认" Then \'如果修改的是标注列 MessageBox.Show("无相关产品") e.Cancel = True \'那么禁止编辑 End If End If e.DataRow.Save() End Select <!--EndFragment-->
|
||||
-- 作者:狐狸爸爸 -- 发布时间:2012/4/17 11:57:00 --
|
||||
-- 作者:czy -- 发布时间:2012/4/17 12:06:00 -- Select Case e.DataCol.Name Case "发货确认" If e.NewValue = True Then Dim dr As DataRow = DataTables("产品表").Find("编码 = \'" & e.DataRow("编码") & "\'and 批次 = \'" & e.DataRow("批次") & "\'") If dr Is Nothing Then MessageBox.Show("无相关产品") e.DataRow("发货确认") = e.OldValue End If End If End Select |