要求简单,如何实现?

690cj 2003-07-04 05:00:02
在数据窗口中(grid型)有三列,分别是编号、品名、价格,只有价格列
可编辑,数据按品名排列,但品名有重复(即连续几行是同一种品名)的现象,现
希望达到如下要求:当品名不连续时,按回车鍵后输入价格即可,但当品名
连续时,按回车鍵后,自动将上一行的价格复制下来,即相同品名的价格只
输入一次,其余的按回车鍵自动生成。
...全文
67 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tulip2108 2003-07-07
  • 打赏
  • 举报
回复
在RowFocusChanged事件编码:

if CurrentRow < 2 then Return

if dwo.name='pm' then
if this.GetItemstring(CurrentRow - 1,"pm") = data then
this.SetItem(CurrentRow, "price", this.GetItemNumber(CurrentRow - 1, "price"))
end if
end if
新增一函数,处理回车换列。

klbt 2003-07-07
  • 打赏
  • 举报
回复
在RowFocusChanged事件编码:

if CurrentRow < 2 then Return

if this.GetItemNumber(CurrentRow,"pm") = this.GetItemNumber(CurrentRow - 1,"pm") then
this.SetItem(CurrentRow, "price", this.GetItemNumber(CurrentRow - 1, "price"))
end if
690cj 2003-07-06
  • 打赏
  • 举报
回复
自己顶一下,并加分至100分,有人能帮忙吗?

611

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧