关于DBGridEh  哪个朋友有DBGridEh这样的例子  让DBGridEh 向excel一样的一行一行的输入数据,还能自动求和,和检测数据输入的合法性的代码 ,1:就是数据一行一行的录入,行末尾换行
2:在输入的过程中,有下拉列表,和能检测这个框输入是否正确

解决方案 »

  1.   

    本来就可以呀,
    如果不行,你可以写一下eh的DBGridEh1SumListRecalcAll
      

  2.   

    procedure Tdtmzd_CostCalc.adsMasterStuffFeeChange(Sender: TField);
    begin
      inherited;
      if not (adsMaster.State in [dsEdit,dsInsert]) then exit;
      adsMaster.FieldByName('StuffCost').AsCurrency:=
      StuffCost(adsMaster.FieldByName('StuffFee').AsCurrency, adsMaster.FieldByName('RatingWaste').AsCurrency);
    end;
    function Tdtmzd_CostCalc.StuffCost(StuffFee, WasteRate: double): double;
    begin
      if WasteRate >= 100 then
      begin
        WarnBox('织造损耗率不能大于等于100%');
        exit;
      end else
      begin
        result := StuffFee / (1- WasteRate/100);
      end;
    end;在ADO控件里的字段的ONCHANGE事件里写