2010-11-22 53 views
0

DevExpree XtraTreeList 컨트롤을 사용하고 있습니다. 첫 번째 레벨 노드 중 하나를 Tree의 첫 번째 노드로 설정하고 싶습니다. TreeList 컨트롤의 메서드 나 TreeListNode 메서드에서TreeListNode 변경 DevExpree TreeList 컨트롤의 인덱스 (위치)

Please Advice.

편집 : 내 코드

private void btnSetMaster_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) 
     { 
      //Load reprot 
      if (treeLstRprtDS.FocusedNode != null) 
      { 
       treeLstRprtDS.SetNodeIndex(treeLstRprtDS.FocusedNode,0); 
       //Get selected underlying object 
       ReportDataSource rprtDataSourceSelected = 
        (ReportDataSource)treeLstRprtDS.GetDataRecordByNode(treeLstRprtDS.FocusedNode); 
       theReport.SetReportDataSourceAsMaster(rprtDataSourceSelected); 
      } 
     } 

편집 :

: 바운드 모드


솔루션을 작업 :

은 내가 XtrTreeList 제어 Read here...

의 CompareNodeValues ​​이벤트를 구현하고 당신이 SetNodeIndex method을 찾고있는 것 같습니다 Column.SortIndex Read here...

답변

0

TreeList를 스크롤하여 특정 노드를 최상위 노드로 설정 하시겠습니까? 그렇다면 TreeList의 TopVisibleNodeIndex 속성을 사용하십시오. 특정 노드가 첫 번째 노드가되어야하는 경우 CompareNodeValues 이벤트 핸들러 내에서 TreeList를 정렬해야합니다.

+0

좋아, 나는 아침에 이벤트를 먼저 해보고 결과를 알려줄거야. –

+0

코드를 사용하여 이벤트를 트리거하는 방법은 무엇입니까? –

+0

이 도움이 http://www.devexpress.com/Support/Center/p/Q267563.aspx 문제를 해결, 감사합니다. –

0

를 사용하여 정렬 할 나무를 강요했다.

+0

맞아요 문서에 따라 http://documentation.devexpress.com/#WindowsForms/DevExpressXtraTreeListTreeList_SetNodeIndextopic 인덱스를 음수로 설정하면 노드가 첫 번째 노드로 나타나야하지만 아무 도움도되지 않습니다. 또한 0을 전달하려고했습니다. 인덱스 –

+0

@ 라미 : 나무가 분류되어 있습니까? – SLaks