CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  PowerBuilder >  基础类

DATAWINDOW内限制多选问题,麻烦。。。

楼主bcbhj(寒(泉泉剑剑))2003-09-02 09:59:35 在 PowerBuilder / 基础类 提问

 
  这样一个DATAWINDOW:   20列,数据只有一行.  
  在这一行中选择3列,用点击方式,点了3个后就不可以再点其他了的,除非再点击已点过的那三列(恢复其未被点击的状态).这都实现了.可是在这20列中点了某列后其它的某几列是不可以点的,请问如何实现??????  
   
  如   datawindow   :     A   B   C   D   E   F   G.........   这一行的数据都不同.DATAWINDOW只有一行数据.  
  点了数据A就不可以点E和G,点了E就不可以点A和G,点了G就不可以点A和E.  
  A,B,C,D,E,F,G...所在的列也不确定,是变动的(确定就很容易实现了,哎,麻烦) 问题点数:20、回复次数:10Top

1 楼liliang800207(redcloud)回复于 2003-09-02 10:49:29 得分 1

关注Top

2 楼bcbhj(寒(泉泉剑剑))回复于 2003-09-02 10:51:47 得分 0

...................................Top

3 楼netspies(从头再来)回复于 2003-09-02 10:53:04 得分 1

说的不太清楚Top

4 楼eminena(俄罗斯方块)回复于 2003-09-02 11:01:31 得分 1

用   modify()   函数   动态修改   列的   Tab   Order   属性.Top

5 楼godofn(筐枉自大)回复于 2003-09-02 11:08:11 得分 12

你可以在数据源中设置计算列,“0   as   count”,然后在程序中的itemchanged事件中判断你的多选列是否发生改变,每次改变都统计已经确定的列,如果已经选了3个就提示,并同时将刚才所选的列设置为非选则状态。  
   
  其实还有一个比较麻烦一点的办法,但是稳定性比较强,就是使用共享数据窗口,两个数据窗口控件使用同一个数据窗口,当你选择的时候用rowscopy函数将该列拷贝到第二个数据窗口控件中,利用第二个数据窗口的行数来控制第一个数据窗口的选择,当然,不能用锁定和“无效”的方法来控制,只能用提示信息和你手动控制的办法来控制用户的选择。Top

6 楼godofn(筐枉自大)回复于 2003-09-02 11:10:00 得分 0

再:Tab   Order   属性会导致选择3个以后无法改变已经选择的项,所以不能使用,用户会有误操作,如果使用Tab   Order   将限制修改。Top

7 楼bcbhj(寒(泉泉剑剑))回复于 2003-09-02 11:11:35 得分 0

每列的Tab   Order都为0,和tab无关.  
  经一番测试,我自己解决了.  
  大家有无好点子Top

8 楼bcbhj(寒(泉泉剑剑))回复于 2003-09-02 11:16:54 得分 0

代码如下:     繁体字   不好意思(没办法,给台湾人做的)  
   
   
  string   cname  
  if   this.GetClickedColumn   (   )<>0   and   integer(This.Describe(dwo.name+   ".border"))<>0   then   //and   this.getitemstring(this.getrow(),this.getclickedcolumn())<>""       then  
        if   this.getitemstring(this.getrow(),this.getclickedcolumn())<>""       then  
  cname=This.Describe(dwo.name+   ".border")  
   
  if   left(trim(dwo.name),8)="process_"   then    
  if integer(cname)<>6   and   ch<=3     then  
  this.modify(dwo.name+".border=6")  
  this.modify(dwo.name+".Background.color=16750848")   //11665407  
  ch++  
  elseif   integer(cname)=6   and   ch>=1     then  
  this.modify(dwo.name+".border=5")  
  this.modify(dwo.name+".Background.color=13554646")   //13160666  
  ch=ch   -1  
  end   if  
  end   if  
  int   i,j  
   
  choose   case     this.getitemstring(this.getrow(),this.GetClickedColumn   (   ))    
  case   "﹚"  
  if   integer(This.Describe(dwo.name+   ".border"))=6   then  
  for   i   =1   to   20  
  if   this.getitemstring(this.getrow(),i)   ="攫"   or   this.getitemstring(this.getrow(),i)   ="琗硁"   then  
  this.Modify("process_"+string(i)+".border=0")  
  end   if  
        next  
  elseif   integer(This.Describe(dwo.name+   ".border"))=5   then  
  for   i   =1   to   20  
  if   this.getitemstring(this.getrow(),i)   ="攫"   or   this.getitemstring(this.getrow(),i)   ="琗硁"   then  
  this.Modify("process_"+string(i)+".border=5")  
  end   if  
        next  
  end   if  
  case   "攫"  
  if   integer(This.Describe(dwo.name+   ".border"))=6   then  
  for   i   =1   to   20  
  if   this.getitemstring(this.getrow(),i)   ="﹚"   or   this.getitemstring(this.getrow(),i)   ="琗硁"   then  
  this.Modify("process_"+string(i)+".border=0")  
  end   if  
        next  
  elseif   integer(This.Describe(dwo.name+   ".border"))=5   then  
  for   i   =1   to   20  
  if   this.getitemstring(this.getrow(),i)   ="﹚"   or   this.getitemstring(this.getrow(),i)   ="琗硁"   then  
  this.Modify("process_"+string(i)+".border=5")  
  end   if  
        next  
  end   if  
  case   "琗硁"  
  if   integer(This.Describe(dwo.name+   ".border"))=6   then  
  for   i   =1   to   20  
  if   this.getitemstring(this.getrow(),i)   ="攫"   or   this.getitemstring(this.getrow(),i)   ="﹚"   then  
  this.Modify("process_"+string(i)+".border=0")  
  end   if  
        next  
  elseif   integer(This.Describe(dwo.name+   ".border"))=5   then  
  for   i   =1   to   20  
  if   this.getitemstring(this.getrow(),i)   ="攫"   or   this.getitemstring(this.getrow(),i)   ="﹚"   then  
  this.Modify("process_"+string(i)+".border=5")  
  end   if  
        next  
  end   if  
  end   choose  
   
  /*  
  cname=This.Describe(dwo.name+   ".border")  
   
  if   left(trim(dwo.name),8)="process_"     and   this.getitemstring(this.getrow(),this.getclickedcolumn())<>""     then    
  if integer(cname)<>6   and   ch<=3     then  
  this.modify(dwo.name+".border=6")  
  this.modify(dwo.name+".Background.color=16750848")   //11665407  
  ch++  
  elseif   integer(cname)=6   and   ch>=1     then  
  this.modify(dwo.name+".border=5")  
  this.modify(dwo.name+".Background.color=13554646")   //13160666  
  ch=ch   -1  
  end   if  
  end   if*/  
  //case   "攫"  
  // return  
  //case   "琗硁"  
  //return  
  //end   choose  
  end   if  
  end   if  
  Top

9 楼bcbhj(寒(泉泉剑剑))回复于 2003-09-02 11:19:20 得分 0

dawindow里的数据不能修改,只供点击选择用的Top

10 楼double22822(大无忧-老实和尚(有事发消息))回复于 2003-09-02 12:25:43 得分 5

把你所有的列做成包含所有项但不重复的几个数组,数组中的各项是不能同时选择的,点击某项是判断其所在数组的upbound   是否大于0。另外判断所有数组的upbound和是否小于3。Top

相关问题

  • 如何在datawindow中限制显示的行数????
  • 怎么限制CheckBoxList1的选择数目
  • datawindow
  • 如何限制复选框被选择选项的数量
  • 怎么限制复选框的选择数量?
  • 怎么限制复选框的选择数量?
  • 一个关于Sybase选择行数限制的问题
  • 如何限制选取图片的大小?
  • 如何限制选取图片的大小?
  • 为何限制流量是灰色不可选的?

关键词

  • 数据
  • 选择
  • 修改
  • 控制
  • dwo
  • getitemstring
  • thenthis
  • getrow
  • 琗硁
  • 攫

得分解答快速导航

  • 帖主:bcbhj
  • liliang800207
  • netspies
  • eminena
  • godofn
  • double22822

相关链接

  • PowerBuilder类图书
  • PowerBuilder类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo