以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  插入行问题,已经解决了  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=6394)

--  作者:kylin
--  发布时间:2010/3/28 22:17:00
--  插入行问题,已经解决了
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:插入行bug.rar

一直向下点击【插入】逻辑列,当出现日期行有空白,就是产生错误的时候,呵呵

前几天一直很忙,没时间来做例子,可是这个Bug老是出现,只得停下来做一个例子来“暴露”这个问题。

说明:这个例子是用开发版做的 【经过老六在6楼指点,原来是自己用代码有瑕疵,不是bug】
[此贴子已经被作者于2010-3-29 8:39:05编辑过]

--  作者:狐狸爸爸
--  发布时间:2010/3/28 22:47:00
--  
没有发现问题啊
--  作者:kylin
--  发布时间:2010/3/28 22:53:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:捕获.png
图片点击可在新窗口打开查看
从第一行开始连续向下点击【插入】到第10行时出现:目标插入的行跳到第2行

我在AfterEdite事件中有写入代码
[此贴子已经被作者于2010-3-28 22:53:46编辑过]

--  作者:狐狸爸爸
--  发布时间:2010/3/28 22:56:00
--  

 

我用菜单的插入行测试,没有管你的代码。


--  作者:kylin
--  发布时间:2010/3/29 8:12:00
--  
以下是引用狐狸爸爸在2010-3-28 22:56:00的发言:

 

我用菜单的插入行测试,没有管你的代码。

我的代码也是引用菜单的插入行Syscmd.Row.Insert(),祥见以下。

如果说这个菜单没有问题,那就当作帮忙纠正我的问题(最近,这个可是最麻烦的问题,天天需要面对),OK?

(有时候,除了插入一空白行,还想再写入一些值)


Dim  edr  as row= e.Row
if edr isnot nothing then
    if  e.Col.Name = "插入"
        If edr("插入") = True then
            dim rnew as row
            dim n as integer  = edr.Index
            if  n =  CurrentTable.rows.count-1 then
                rnew =  CurrentTable.addnew
             else
                CurrentTable.Position = n+1             
                Syscmd.Row.Insert()
                rnew = CurrentTable.rows(n+1)
            end if
             rnew("日期")  = edr("日期").AddDays(1)
        End If
    End If
End If

[此贴子已经被作者于2010-3-29 8:12:25编辑过]

--  作者:狐狸爸爸
--  发布时间:2010/3/29 8:29:00
--  
Dim  edr  as row = e.Row
if edr isnot nothing then
    if  e.Col.Name = "插入"
        Dim rnew as Row
        If edr("插入") = True then
            if  e.table.position =  CurrentTable.rows.count-1 then
                rnew =  CurrentTable.Rows.addnew
            else
                rnew = CurrentTable.Rows.InsertNew
            end if
            rnew("日期")  = edr("日期").AddDays(1)
        End If
    End If
End If

--  作者:kylin
--  发布时间:2010/3/29 8:37:00
--  
以下是引用狐狸爸爸在2010-3-29 8:29:00的发言:
Dim  edr  as row = e.Row
if edr isnot nothing then
    if  e.Col.Name = "插入"
        Dim rnew as Row
        If edr("插入") = True then
            if  e.table.position =  CurrentTable.rows.count-1 then
                rnew =  CurrentTable.Rows.addnew
            else
                rnew = CurrentTable.Rows.InsertNew
            end if
            rnew("日期")  = edr("日期").AddDays(1)
        End If
    End If
End If

多谢,呵呵
给你添麻烦!