一个数据窗口中有2列,现在想实现选中第一列之后,第二列自动显示想对应的信息,2者是一对一的关系,如何实现?
很急,在线等
方法越简单越好
------解决方案--------------------
click事件写如下代码:
string ls_1,ls_2
if row = 0 then return //点标题头退出
if string(dwo.name) = this.describe('#' + string(1) + ".name") then //点第一列时触发
ls_1 = getitemstring(row, string(dwo.name)) //取第一列内容
select OOXX into :ls_2 from Table where XXOO = :ls_1 using sqlca;//获取第二列相关内容
if sqlca.sqlcode = 0 then //取到了
setitem(row,this.describe('#' + string(2) + ".name"),ls_2) //给第二列赋值
end if
end if