zoukankan      html  css  js  c++  java
  • cxGrid使用汇总

    1、自动行高:CellAutoHeight(单元自动高度)设置为True.

    procedure <AForm>.<AGridColumn>PropertiesValidate(Sender: TObject; var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
    var
      AColumn: TcxGridDBColumn;
      AColIndex: Integer;
    begin
      AColumn := <AcxGridDBTableView>.GetColumnByFieldName(<Field Name>);
      AColIndex := AColumn.Index;
      ...
    end;


    procedure TForm_Sales.col_Reg_Price_UnitPropertiesEditValueChanged(
      Sender: TObject);
    var Edit : TcxCustomEdit;
        c_Now,
        c_Was : currency;
        i_Rate : integer;
    begin
      Edit := Sender as TcxCustomEdit;

      if (Edit <> nil) and
         (Table_Reg.FieldByName(GD_Tab_Sales_Items_Quan).AsFloat > 0) then
        begin
          c_Now := Edit.EditingValue;
          c_Was := Table_Reg.FieldByName(GD_Tab_Sales_Items_Retail_Unit).AsCurrency;
          i_Rate := 100 - trunc(100 * (c_Now / c_Was));

          if (i_Rate > Info_Clerk.Discount_Max) then
            begin
              tv_Reg.DataController.SetEditValue(col_Reg_Price_Unit.Index,
                                                 Table_Reg.FieldByName(GD_Tab_Sales_Items_Price_Unit).AsCurrency,
                                                 evsValue);
              ShowMessage(‘The requested discount of ' + IntToStr(i_rate) + '% exceeds the allowed maximum clerk discount of ' + IntToStr(Info_Clerk.Discount_Max) + '%.');
            end;
        end;
    end;

    procedure TForm1.cxDateEdit1PropertiesValidate(Sender: TObject;
    
      var DisplayValue: Variant; var ErrorText: TCaption; var Error: Boolean);
    
    begin
    
      if DisplayValue = 'TEST' then
    
      begin
    
        DisplayValue := '01/01/2004';
    
        Error := False;
    
      end;
    
    end;
  • 相关阅读:
    关于机器人流量对抗的一点感想
    保卫"木叶",从火影剧情看网站攻防的演变
    自动化工具层级图
    对抗恶意机器人/自动化行为的新思路与方案
    C++ 数组、链表和二叉树的比较
    #ifndef和#define区别
    xavier上安装teamviewer
    Ubuntu16.04 下有关conda虚拟环境的一些使用方法
    vector中push_back和emplace_back的区别
    int、int16、int32、int64、float、float16、float32、float64
  • 原文地址:https://www.cnblogs.com/railgunman/p/8018220.html
Copyright © 2011-2022 走看看