Home - Forums-.NET - FlyTreeView (ASP.NET) - Using Move & Select Events together

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

Using Move & Select Events together
Link Posted: 14-Jul-2008 22:14
I have a Move Event so that I can detect when a Node has been Moved. I also have a Select Event so I can detect when a Node was selected.

The problem is that the Select Event appears to be preventing the Drag & Drop from working.

What I am looking to do is:

1. OnClick / Select of a Node : Fill TextFields from the database
2. OnMove : Update the database with a new ParentId

How would you recommend getting this functionality in my code?
Link Posted: 15-Jul-2008 00:24
There are two ways to handle node selection:

First one is NodeSelected (NodeDeselected) event - this event is fired multiple times when treeview loads postback data (same behavior as for NodeMoved)

Second one is SelectedNodeChanged - this is a regular event that occurs after Page_Load and fired only once (provides previous selected node (previous postback) and currently selected node).
Link Posted: 15-Jul-2008 01:39
I have this working now, but it's a tad cumbersome because when I click it executes code and I can occasionally lose the selected item I am dragging.

Is there any way you could recommend where I could wrap my select code in that will ensure I'm not losing the item being dragged?
Link Posted: 15-Jul-2008 01:54
I'm not sure what behavior you expect to get.
When you select some node, then page postbacks. Isn't it?
So you cannot continue D&D because of page reload.
Link Posted: 15-Jul-2008 02:05
Well what I was hoping for was OnMouseUp, so essentially it know I've pressed down the mouse and wait for mouse up.

Is there any event that perhaps would behave like that?
Link Posted: 15-Jul-2008 17:35
This is really low level event, that is not provided for public access.
You can create a wrapper around your content in node.Text and handle this event yourself. But I do not think it would help much.