以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  index 问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=186628)

--  作者:edisontsui
--  发布时间:2023/5/16 15:40:00
--  index 问题
Dim cr1 As Row = e.Table.rows(e.Row.index + 1)
上面这句代码是 drawcell 里面的,但是放在 datacolchanging 里面却会提示:不是 datacoleventargs 的成员。请问要怎样修改它呢?谢谢。

--  作者:有点蓝
--  发布时间:2023/5/16 15:44:00
--  
看看:http://www.foxtable.com/webhelp/topics/0604.htm
--  作者:edisontsui
--  发布时间:2023/5/16 15:59:00
--  
还是不明白怎么改代码。
--  作者:有点蓝
--  发布时间:2023/5/16 16:11:00
--  
想要做什么功能
--  作者:edisontsui
--  发布时间:2023/5/16 17:09:00
--  
就是要定位现在处于哪一行(行号是多少),然后我才可以定位上一行和下一行的行号。
--  作者:有点蓝
--  发布时间:2023/5/16 17:11:00
--  
http://www.foxtable.com/webhelp/topics/0553.htm

dim idx as integer = tables("表A").FindRow(e.datarow)
msgbox(idx)

--  作者:edisontsui
--  发布时间:2023/5/16 17:21:00
--  
datacolchanging:

If e.DataCol.Name = "热处理" Then
    If e.DataRow("完成日期类别") = "实际" Then
        If e.NewValue IsNot Nothing Then
           \'Dim cr1 As Row = e.Table.rows(e.Row.index - 1)
            \'Dim nms() As String = {"模具设计", "材料采购", "机加", "CNC1"}
            \'For s As Integer = 0 To nms.length - 1 
            \'    If cr1.isnull(nms(s)) Then
            \'    Else
            \'        If e.DataRow.isnull("nms(s)") Then
            \'            MessageBox.Show("前面还有工序没有完成呢!")
            \'            e.Cancel = True 
            \'        End If 
            \'    End If
            \'Next
        End If
    End If
End If

就是红色那句代码。谢谢。

--  作者:有点蓝
--  发布时间:2023/5/16 17:27:00
--  
dim idx as integer = tables("表A").FindRow(e.datarow)
Dim cr1 As Row = tables("表A").rows(idx  - 1)