TdxLookupTreeView的简单使用

object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'tree'
  ClientHeight = 411
  ClientWidth = 638
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object dxLookupTreeView1: TdxLookupTreeView
    Left = 112
    Top = 56
    Width = 145
    Height = 21
    CanSelectParents = True
    ParentColor = False
    TabOrder = 0
    TabStop = True
    Text = '1_'#32455#24067#21378
    TreeViewColor = clWindow
    TreeViewCursor = crDefault
    TreeViewFont.Charset = DEFAULT_CHARSET
    TreeViewFont.Color = clWindowText
    TreeViewFont.Height = -11
    TreeViewFont.Name = 'Tahoma'
    TreeViewFont.Style = []
    TreeViewIndent = 19
    TreeViewReadOnly = False
    TreeViewShowButtons = True
    TreeViewShowHint = False
    TreeViewShowLines = True
    TreeViewShowRoot = True
    TreeViewSortType = stNone
    DividedChar = '.'
    ListSource = DataSource1
    KeyField = 'fid'
    ListField = 'fName'

    Options = [trDBCanDelete, trDBConfirmDelete, trCanDBNavigate, trSmartRecordCopy, trCheckHasChildren]
    ParentField = 'fParentID'
    RootValue = Null
    TextStyle = tvtsShort
    Alignment = taLeftJustify
  end
  object ClothuConnection: TFDConnection
    Params.Strings = (
      'ConnectionDef=ClothU')
    Connected = True
    LoginPrompt = False
    Left = 477
    Top = 68
  end
  object TdepartmentTable: TFDQuery
    Active = True
    Connection = ClothuConnection
    SQL.Strings = (

        'select fid,fParentID,fCode,fCode+'#39'_'#39'+fName as fName from base.tD' +
        'epartment'
      '')

    Left = 477
    Top = 116
  end
  object DataSource1: TDataSource
    DataSet = TdepartmentTable
    Left = 472
    Top = 176
  end
end

 

运行结果

TdxLookupTreeView的简单使用