怎么把DBgrid组件的值改变!!!!!!
比如:DBGRID组件的数据库源的表为TABLE,但TABLE有一字段为Ismarry且该字段为bit 型,我想当ismarry为1是,DGGRID组件显示为结婚,为0时。显示为未婚
怎样设置!!!!!

解决方案 »

  1.   

    在字段的ongettext()事件里加个判断语句
    if ismarry=1 then
    text=‘结婚'
    else
    text='未婚'
    大概是这样你看看
      

  2.   

    select Field1,Field2,(case ismarry when 1 then '结婚' else '未婚' end) from Table
      

  3.   

    同意楼上,ongettext()事件的位置
    双击adoquery,出现方框,右键add all fields
    然后选择一个field,其事件里有gettext()
    写上即可
      

  4.   

    后台数据库是sql server是可以用:
    select newfield= case ismarry when 1 then '结婚' when 0 then '未婚' end from tablename