如何使用DBGrid的column属性的picklist如下所示我的数据库有一字段 A1
其可能的值为1,2,3,4
而我要对应显示为
A1 A1的值
1  aa
2  bb
3  cc
4  dd注意,数据集只能用table,不能修改

解决方案 »

  1.   

    在PickList中添加:
    aa
    bb
    cc
    dd
    在table的A1的OnGetText中添加如下代码:
      case Sender.Value of
        1:  Text := 'aa';
        2:  Text := 'bb';
        3:  Text := 'cc';
        4:  Text := 'dd';
      end;
    在table的A1的OnSetText中添加如下代码:
      if Text = 'aa' then
        Sender.Value := 1
      else if Text = 'bb' then
        Sender.Value := 2
      else if Text = 'cc' then
        Sender.Value := 3
      else if Text = 'dd' then
        Sender.Value := 4
      

  2.   

    问题是我的table在程序运行才能获得数据,怎么办呀,我不要添加静态永久字段
      

  3.   

    table在程序运行才能获得数据和静态永久字段并不冲突啊!