您的位置:首页 > 其它

获取CxDBTreeList所有父节点

2014-03-14 10:36 471 查看
function  ShowCxDBTreeListNodeValues(ACxDBTreeList:
TcxDBTreeList): string; 
var 
S:string; 
aNode:TcxTreeListNode; 
i:Integer; 
begin 
  if ACxDBTreeList.Visible then 
    if ACxDBTreeList.FocusedNode.HasChildren then //只显示最底层,如果要显示全部  去掉这个条件
     Exit; 
  aNode:=ACxDBTreeList.FocusedNode; 
  for i:=aNode.Level downto 0 do 
  begin 
  if i=ACxDBTreeList.FocusedNode.Level then 
    S:=aNode.Values[1] 
  else 
    S:=aNode.Values[1]+'->'+S; 
  aNode:=aNode.Parent; 
  Result:=S; 
  end; 
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: