Foxtable(狐表)用户栏目专家坐堂 → 行列定位编辑问题


  共有293人关注过本帖树形打印复制链接

主题:行列定位编辑问题

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110135 积分:560481 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/10/8 10:38:00 [显示全部帖子]

prepareedit事件
if e.col.name = "第一列" then
if e.row("方向") <> “A”
e.cancel=true
end if
elseif e.col.name = "第二列" then
if e.row("方向") <> “B”
e.cancel=true
end if
else
e.cancel=true
end if

keydownedit事件
if e.KeyCode=keys.enter then
if e.row.index < e.table.rows.count - 1
if e.row("方向") = "A"
e.table.select(e.row.index+1,1)
e.cancel=true
elseif e.row("方向") = "B"
e.table.select(e.row.index+1,2)
e.cancel=true
en dif
end if
end if

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110135 积分:560481 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/10/8 15:10:00 [显示全部帖子]

可否编辑,和光标设置必须分开2个事件。看2楼

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110135 积分:560481 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/10/8 16:09:00 [显示全部帖子]

if e.Row.IsNull("方向") = False then
If e.Col.name = "第一列" Then
    If e.Row("方向") <> "A" Then
        e.cancel = True
    End If
ElseIf e.Col.name = "第二列" Then
    If e.Row("方向") <> "B" Then
        e.cancel = True
    End If
End If
End If

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110135 积分:560481 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/10/8 17:29:00 [显示全部帖子]

keydownedit事件

If e.Col.Name = "方向" andalso e.KeyCode=keys.enter  Then
  if e.text = "A"
e.table.select(e.row.index,e.table.cols("第一列").index)
e.cancel=true
elseif e.text  = "B"
e.table.select(e.row.index,e.table.cols("第二列").index)
e.cancel=true
endif
End If

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110135 积分:560481 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/10/8 20:09:00 [显示全部帖子]

datacolchanged事件

If e.dataCol.Name = "方向Then
  if e.newvlaue = "A"
dim idx as integer = tabels("当前表名").findrow(e.datarow)
tabels("当前表名").select(idx ,tabels("当前表名").cols("第一列").index)
elseif e.newvlaue = "B"
dim idx as integer = tabels("当前表名").findrow(e.datarow)
tabels("当前表名").select(idx ,tabels("当前表名").cols("第二列").index)
endif
End If

 回到顶部