以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  克隆选中的行,但日期列等于今天,代码是什么呢  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=147515)

--  作者:蓝蚂蚁
--  发布时间:2020/3/18 15:16:00
--  克隆选中的行,但日期列等于今天,代码是什么呢
下面的代码是克隆选中的行,其中新增日期=today()
Dim t As Table = e.Form.controls("Table1").Table
If MessageBox.Show("是否克隆选中的数据?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question)=DialogResult.Yes Then
    With t
        For i As Integer = .BottomPosition To .TopPosition Step -1
            .Rows(i).clone()
            .Rows(i)("新增日期")=today()
        Next
    End With
End If
这段代码有问题,表现为,被克隆行的日期会清空,麻烦老师帮看看,谢谢!

--  作者:有点蓝
--  发布时间:2020/3/18 15:54:00
--  
        For i As Integer = .BottomPosition To .TopPosition Step -1
            dim r as row = .Rows(i).clone()
            r("新增日期")=today()
        Next