public void CopySettings(DevExpress.XtraTreeList.TreeList sourceTL, DevExpress.XtraTreeList.TreeList targetTL) { targetTL.ForceInitialize(); targetTL.OptionsView.AutoWidth = sourceTL.OptionsView.AutoWidth; targetTL.OptionsView.ShowAutoFilterRow = sourceTL.OptionsView.ShowAutoFilterRow; targetTL.OptionsView.ExpandButtonCentered = sourceTL.OptionsView.ExpandButtonCentered; targetTL.OptionsView.FocusRectStyle = sourceTL.OptionsView.FocusRectStyle; targetTL.OptionsView.EnableAppearanceEvenRow = sourceTL.OptionsView.EnableAppearanceEvenRow; targetTL.OptionsView.EnableAppearanceOddRow = sourceTL.OptionsView.EnableAppearanceOddRow; targetTL.OptionsView.ShowFilterPanelMode = sourceTL.OptionsView.ShowFilterPanelMode; targetTL.OptionsView.HeaderFilterButtonShowMode = sourceTL.OptionsView.HeaderFilterButtonShowMode; targetTL.OptionsView.ShowBandsMode = sourceTL.OptionsView.ShowBandsMode; targetTL.OptionsView.ShowButtons = sourceTL.OptionsView.ShowButtons; targetTL.OptionsView.ShowColumns = sourceTL.OptionsView.ShowColumns; targetTL.OptionsView.ShowHorzLines = sourceTL.OptionsView.ShowHorzLines; targetTL.OptionsView.ShowIndicator = sourceTL.OptionsView.ShowIndicator; targetTL.OptionsView.ShowPreview = sourceTL.OptionsView.ShowPreview; targetTL.OptionsView.ShowRoot = sourceTL.OptionsView.ShowRoot; targetTL.OptionsView.ShowRowFooterSummary = sourceTL.OptionsView.ShowRowFooterSummary; targetTL.OptionsView.ShowSummaryFooter = sourceTL.OptionsView.ShowSummaryFooter; targetTL.OptionsView.ShowVertLines = sourceTL.OptionsView.ShowVertLines; targetTL.KeyFieldName = sourceTL.KeyFieldName; targetTL.ParentFieldName = sourceTL.ParentFieldName; targetTL.ActiveFilterString = sourceTL.ActiveFilterString; targetTL.DataSource = sourceTL.DataSource; targetTL.DataMember = sourceTL.DataMember; targetTL.FixedLineWidth = sourceTL.FixedLineWidth; targetTL.Columns.Clear();//reset all columns foreach (DevExpress.XtraTreeList.Columns.TreeListColumn col in sourceTL.Columns) { DevExpress.XtraTreeList.Columns.TreeListColumn colToken = targetTL.Columns.AddField(col.FieldName); colToken.Caption = col.GetCaption(); colToken.SortIndex = col.SortIndex; colToken.SortMode = col.SortMode; colToken.SortOrder = col.SortOrder; colToken.Visible = col.Visible; colToken.VisibleIndex = col.VisibleIndex; colToken.Width = col.Width; colToken.UnboundExpression = col.UnboundExpression; colToken.UnboundType = col.UnboundType; } }
public void ForceInitialize() { _tree.ForceInitialize(); }