2010-05-05 100 views
0

我想通過拖動移動TcxDBTreeList中的樹節點(db記錄),該組件是否有這個選項的屬性?DevExpress> TcxDBTreeList拖放樹節點(記錄)

+2

哎唷!祝你好運,找到CX網格上的任何工作。所有的實際功能都埋藏在層層疊疊的瘋狂難以穿透的建築中。 – 2010-05-05 04:00:32

+0

問問這個問題的最佳地方是devexpress支持網站http://www.devexpress.com/Support/Center/ – 2010-05-05 07:45:20

回答

2

啓用拖放記錄上TcxDbTreeList

下面寫事件的代碼;

onBeginDragNode事件

Allow:= True; 

onDragOver事件

Accept:=True; 

設置cxDbTreeList的DRAGMODE物業

DragMode:=dmAutomatic; 
1

檢查OnBeginDragNode事件。這看起來是你想要做的最好的地方。

+0

@yozey:onbegindragnode事件解決了我的問題。 – adnanturken 2010-05-05 21:17:02

+0

很高興我能幫忙:-)。 – yozey 2010-05-06 00:59:40

0

我發現我其實是有移動節點自己:

procedure TForm1.cxDBTreeList1MoveTo(...); 
    var i:integer; 
begin 
    for i := 0 to Nodes.Count - 1 do 
     begin 
      // move the node in the tree 
      TcxTreeListNode(Nodes[i]).MoveTo(AttachNode, AttachMode); 
      // change the database to match 
      UpdateParentForNode(NodeID, NewParentID, SortSpecifier); 
    end; 
    Done := True; 
end; 

它使一定量的在DBTreeView意義 - 電網並不真正需要知道的好辦法究竟如何想要更改移動的行。可能需要修改排序順序以及父ID。