1.获取当前被选中的节点数据

string tmp = treeL.FocusedNode.GetDisplayText(this.treeListColumnIndex);

2.是否允许编辑

treeList1.OptionsBehavior.Editable = false / true;

3.是否显示列头

treeList1.OptionsView.ShowColumns= false / true;

4.如何让TreeList的每个结点高亮显示

private void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)

        {

            TreeList node = sender as TreeList;

            if (e.Node == node.FocusedNode)

            {

                e.Graphics.FillRectangle(SystemBrushes.Window, e.Bounds);

                Rectangle r = new Rectangle(e.EditViewInfo.ContentRect.Left,e.EditViewInfo.ContentRect.Top,

                                            Convert.ToInt32(e.Graphics.MeasureString(e.CellText, treeList1.Font).Width + 1),

                                            Convert.ToInt32(e.Graphics.MeasureString(e.CellText,treeList1.Font).Height));

                e.Graphics.FillRectangle(SystemBrushes.Highlight, r);

                e.Graphics.DrawString(e.CellText, treeList1.Font, SystemBrushes.HighlightText, r);

                e.Handled = true;

            }

        }

5.是否显示树的级联虚线

LookAndFeel》UseDefaultLookAndFeel=false; && UseWindowsXPTheme=true;//显示   否则隐藏

6.选中具体节点触发的事件

FocusedNodeChanged

05-11 10:54