1、TreeList设置内容不可编辑,在OptionBehavior中的Editable属性设置为false即可.GridControl同样
2、TreeList获取节点的内容,node.GetDisplayText(object ColumnID),参数为获取列的编号;
3、TreeList鼠标右键绑定事件:
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;
}
}
}
本文介绍了如何在TreeList组件中禁用内容编辑及获取节点内容的方法,包括设置OptionBehavior中的Editable属性为false,以及使用node.GetDisplayText(objectColumnID)获取指定列的显示文本。
401

被折叠的 条评论
为什么被折叠?



