DBGrid如何将true边为中文的真或者其他值?还有如何过滤一些记录。比如小于0的数据不显示。但是数据原里边有。

解决方案 »

  1.   

    不显示出来:select * from tablename where 字段<0
     select case when 字段=0 then '是(你想要的显示值)' when 字段=1 then '否'  end from tablename  
    显示为是或否 
      

  2.   

    select case A1(字段) when true then '真' end from TableName where A2>=0
      

  3.   

    你就在dbgriddrawCell中写一个转化,将实际的数据转换为你想要得东西!使用Canvas.Draw
      

  4.   

    在table(或query)的相应字段的OnGetText事件中这样写:if sender.Value=true then Text:='这是真的'//中文
                         else Text:='这是假的';if sender.Value<0 then text:='';//小于零不显示
      

  5.   

    别用DBGRID了吧,花那么多工夫去满足一点点界面上的需求,不值得.用CXGRID吧, 大把的花哨功能.
      

  6.   

    Ehlib控件中的DBGrideh也可以实现这样的功能