TreeList右键功能及常见设置

1、TreeList设置内容不可编辑,在OptionBehavior中的Editable属性设置为false即可.GridControl同样
2、TreeList获取节点的内容,node.GetDisplayText(object ColumnID),参数为获取列的编号;
3、TreeList鼠标右键绑定事件:

 private void MenuList_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                MenuList.ContextMenu = null;
                TreeListHitInfo hInfo = MenuList.CalcHitInfo(new Point(e.X, e.Y));
                TreeListNode node = hInfo.Node;
                if (node != null)
                {
                    MenuList.FocusedNode = node;
                    MenuList.ContextMenuStrip = contextMenu;
                }
            }
        }



posted @ 2014-07-08 16:34  静以养身 俭以养德  阅读(243)  评论(0编辑  收藏  举报