procedure TfrmsysWorkManage.DBTreeCreateNode(Sender: TObject; Node: TdxOcNode);
begin
inherited;
with Node,WorkCDS do
begin
Node.ChildAlign := GetNodeAlign(FindField('显示方式').AsString);
Node.ImageAlign := GetImageAlign(FindField('索引位置').AsString);
end;
end;
控件设置:
object DBTree: TdxDbOrgChart
Left = 1
Top = 1
Width = 361
Height = 469
KeyFieldName = 工作流自动编号
ParentFieldName = 父编号
TextFieldName = 角色名称
OrderFieldName = 父编号
ImageFieldName = 索引值
DefaultNodeWidth = 90
DefaultNodeHeight = 70
Options = [ocSelect, ocFocus, ocButtons, ocDblClick, ocEdit, ocCanDrag, ocShowDrag, ocInsDel, ocRect3D, ocAnimate]
EditMode = [emCenter, emVCenter, emWrap]
Images = BaseDM.ilBtn_E
DefaultImageAlign = iaLT
OnCreateNode = DBTreeCreateNode
Align = alClient
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
PopupMenu = PopupMenu
ParentFont = False