您的位置:首页 > 其它

DevExpress.XtraTreeList.TreeList 控件如何找到当前被选中的节点

2013-04-01 14:19 686 查看
原文出自:http://blog.csdn.net/nash603/article/details/5923727

问题: 不知道DevExpress.XtraTreeList.TreeList 控件的哪个成员函数能够让我们找到当前树形结构中被选中的节点

解决方案: string tmp = treeL.FocusedNode.GetDisplayText(this.treeListColumnIndex);

一开始以为肯定是DevExpress.XtraTreeList.TreeList的成员函数里面以“get...”“selected”开头的函数,一直找不到。

后来google之,在国外论坛发现以下一段评论:

The following help topic has an example of how to append nodes at run time. Note that the number and order of objects in the array for the first parameter of the AppendNode method must match the number and order of tree list columns that are in the tree list.

http://www.devexpress.com/Help/Content.aspx?help=XtraTreeList&document=CustomDocument5559.htm

You may use the GetValue or GetDisplayText method of a TreeListNode to get data from the selected node. The FocusedNode property of the tree list will access the currently focused TreeListNode.

http://www.devexpress.com/Help/Content.aspx?help=XtraTreeList&document=CustomDocument5639.htm

终于知道原来是FocusedNode 这个函数,晕死,汗
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: