zoukankan      html  css  js  c++  java
  • TwwDBGrid + TwwDBLookupCombo 下拉列表

     目标标求:点击TwwDBGrid中的sPartCode字段弹出下拉列表

    平台 :DELPHI 10.3 +INFO POWER 4K 20.0+  WIN7 64

    大致步骤  :

    1.  wwDBLookupCombo1,{位置任意}
    2.  wwDBGrid1  

    object Form1: TForm1
      Left = 0
      Top = 0
      Caption = 'Form1'
      ClientHeight = 418
      ClientWidth = 554
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      OldCreateOrder = False
      PixelsPerInch = 96
      TextHeight = 13
      object wwDBLookupCombo1: TwwDBLookupCombo  {查找表,就是下拉列表中可以看到的内容}
        Left = 96
        Top = 64
        Width = 121
        Height = 21
        DropDownAlignment = taLeftJustify
        Selected.Strings = (
          'fCode'#9'15'#9'fCode'#9'F'#9
          'fName'#9'24'#9'fName'#9'F'
          'fColor'#9'10'#9'fColor'#9'F'#9
          'fSpec'#9'10'#9'fSpec'#9'F'#9
          'fUnitsName'#9'10'#9'fUnitsName'#9#9)
        DataField = 'fPartID'
        DataSource = dsBOM
        LookupTable = TproductTable
        LookupField = 'fID'
        Options = [loColLines, loRowLines, loTitles]
        TabOrder = 0
        AutoDropDown = False
        ShowButton = True
        PreciseEditRegion = False
        AllowClearKey = False
      end


      object wwDBGrid1: TwwDBGrid
        Left = 0
        Top = 216
        Width = 554
        Height = 202
        ControlType.Strings = (
          'sPartCode;CustomEdit;wwDBLookupCombo1;F')
        Selected.Strings = (
          'sPartCode'#9'20'#9'sPartCode'
          'fPartID'#9'10'#9'fPartID'
          'fUnit'#9'50'#9'fUnit'
          'fQty'#9'10'#9'fQty'
          'fBeginTime'#9'34'#9'fBeginTime'
          'fEndTime'#9'34'#9'fEndTime'
          'fNotes'#9'200'#9'fNotes')
        IniAttributes.Delimiter = ';;'
        IniAttributes.UnicodeIniFile = False
        TitleColor = clBtnFace
        FixedCols = 0
        ShowHorzScrollBar = True
        Align = alBottom
        DataSource = dsBOM
        TabOrder = 1
        TitleAlignment = taLeftJustify
        TitleFont.Charset = DEFAULT_CHARSET
        TitleFont.Color = clWindowText
        TitleFont.Height = -11
        TitleFont.Name = 'Tahoma'
        TitleFont.Style = []
        TitleLines = 1
        TitleButtons = False
      end
      object ClothuConnection: TFDConnection
        Params.Strings = (
          'ConnectionDef=ClothU')
        Connected = True
        LoginPrompt = False
        Left = 435
        Top = 54
      end


      object TbomTable: TFDQuery
        Active = True
        Connection = ClothuConnection
        SQL.Strings = (
          'SELECT [fParentID]'
          '      ,[fPartID]'
          '      ,[fUnit]'
          '      ,[fQty]'
          '      ,[fBeginTime]'
          '      ,[fEndTime]'
          '      ,[fNotes]'
          '  FROM [ClothU].[base].[tBom]')
        Left = 331
        Top = 86
        object TbomTablesPartCode: TStringField
          DisplayWidth = 20
          FieldKind = fkLookup
          FieldName = 'sPartCode'   {计算字段}
          LookupDataSet = TproductTable
          LookupKeyFields = 'fID'
          LookupResultField = 'fCode'
          KeyFields = 'fPartID'
          Lookup = True
        end


        object TbomTablefPartID: TIntegerField
          DisplayWidth = 10
          FieldName = 'fPartID'
          Origin = 'fPartID'
          ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
          Required = True
        end
        object TbomTablefUnit: TWideStringField
          DisplayWidth = 50
          FieldName = 'fUnit'
          Origin = 'fUnit'
          Size = 50
        end
        object TbomTablefQty: TCurrencyField
          DisplayWidth = 10
          FieldName = 'fQty'
          Origin = 'fQty'
          Required = True
        end
        object TbomTablefBeginTime: TSQLTimeStampField
          DisplayWidth = 34
          FieldName = 'fBeginTime'
          Origin = 'fBeginTime'
        end
        object TbomTablefEndTime: TSQLTimeStampField
          DisplayWidth = 34
          FieldName = 'fEndTime'
          Origin = 'fEndTime'
        end
        object TbomTablefNotes: TWideStringField
          DisplayWidth = 200
          FieldName = 'fNotes'
          Origin = 'fNotes'
          Size = 200
        end
        object TbomTablefParentID: TIntegerField
          DisplayWidth = 10
          FieldName = 'fParentID'
          Origin = 'fParentID'
          ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
          Required = True
          Visible = False
        end
      end
      object TproductTable: TFDQuery   {查找表}
        Active = True
        Connection = ClothuConnection
        SQL.Strings = (
          
            'Select fID,fCode,fName,fColor,fSpec,fUnitsName from base.vProduc' +
            't')
        Left = 436
        Top = 138
      end
      object dsBOM: TDataSource
        DataSet = TbomTable
        Left = 336
        Top = 152
      end
    end

     

    设计时

     

     

  • 相关阅读:
    Lambda表达式详解
    .net反射详解
    vue插件大全汇总
    DockerToolbox在Win7上的安装和设置
    Ubuntu 16.04 安装 Python3.6
    Azkaban实战,Command类型单一job示例,任务中执行外部shell脚本,Command类型多job工作flow,HDFS操作任务,MapReduce任务,HIVE任务
    Azkaban 使用问题及解决(一)
    Azkaban各种类型的Job编写
    azkaban执行错误 Job failed, Cannot request memory (Xms 0 kb, Xmx 0 kb) from system for job
    window7 修改docker安装的machine 位置
  • 原文地址:https://www.cnblogs.com/jijm123/p/14271409.html
Copyright © 2011-2022 走看看