Home - Forums-.NET - FlyTreeView (ASP.NET) - drop to parantnode

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

drop to parantnode
Link Posted: 13-Aug-2006 22:04
Hi,

My treeview displays \"item\" and \"folders\". When the user drops something on an \"item\" node, I want the new node created to the parent of the \"item\" node because that would be the \"folder\".

I handle this serverside on the InsertCallbackNodesFromValue method. and in case of a node type \"item\" (value in the tag) instead of e.Nodes.Add(newnode); I try something like e.ParentNode.ChildNodes.Add() but the node is never displayed.

How can I fix this.
Link Posted: 13-Aug-2006 22:21
The reasons of such behavior is the following:
You cannot manage new node position during the call-back time, it is fixed by client-side code. Only node value, text, etc. This is one of call-back limitations. The FlyTreeView does not reload the whole treeview, but it loads a part of it - a single node - and places it in a selected (before callback) place.

The possible solution - is to raise a page postback after drop and place required node into required position.
Link Posted: 13-Aug-2006 22:29
could I handle this client-side? \"OnDrop\" fires before \"OnInsertCallbackNodesFromValue\". Could I replace the target with for instance target.parent?
Link Posted: 14-Aug-2006 19:41
Currently you cannot change the target, but you may try to  cancel the drag-drop operation (see http://www.9rays.net/asp.net_2/treeview/Doc_ClientEvents.aspx for the OnDropJavascript description). Then you should probably create a new instance of CFlyTreeNode, set its text and other properties and add it to a parent node using the addNode() method.[/list]