在dbgrideh的列中怎样按需显示数据?
我在做一个彩票软件,其中有一个数据显示问题,在一张表中有三列(百位,十位,个位),就百位来说,要显示成下面的样子
表中数据 显示数据
百位
百位 |0|1|2|3|4|5|6|7|8|9|
0 0
5 5
7 7
9 9
3 3
2 2
...
也就是一个中奖号码走势图,当百位号码是0,就显示在0列的位置,是5就显示在5列的位置,依次类推;
我用dbgrideh设计好的表头,下面就不知该怎样做了?用绑定字段的方式好像不行,用程序控制,不知在dbgrideh中怎样给指定的行,列赋值,请高手指点!
[解决办法]
在ADOQuery中加入如下栏位就可:
case when 百位=0 then 0 end,
case when 百位=1 then 1 end,
case when 百位=2 then 2 end,
case when 百位=3 then 3 end,
case when 百位=4 then 4 end,
case when 百位=5 then 5 end,
case when 百位=6 then 6 end,
case when 百位=7 then 7 end,
case when 百位=8 then 8 end,
case when 百位=9 then 9 end
[解决办法]
5楼的意思是输出结果集的时候吧
dataset字段编辑器新建你需要的那几个字段
然后在OnCalcFields计算后赋值