Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag node from Treelist & drop on Diagramviewe (Read 4348 times)
deepak
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jun 29th, 2011
Drag node from Treelist & drop on Diagramviewe
Jul 8th, 2011 at 10:11am
Print Post  

Hi

I have used the Treelist (from Devexpress), Diagramviewer (from FCNetDemo) & Listbox in my Winform (which is developed in c#).

The Listbox fill by Conditions like if-else, while etc. I used WorkflowDesigner Demo for reference.

1 . I drag if-else condition from listbox & drop on Diagramviewer.
2 . On the above if-else condition I want to add Treelist node.
(drag node from & drop on diagramviewer IF-else condition).

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag node from Treelist & drop on Diagramv
Reply #1 - Jul 8th, 2011 at 11:17am
Print Post  
Hi,

Flowchart.NET has a built-in tree component implemented by TreeViewNode, you could add it to the workflow instead of the current ShapeNodes. If you need a specific feature of DevExpress' Treelist, add a ControlNode hosting a Treelist instance instead of the ShapeNode.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
deepak
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Jun 29th, 2011
Re: Drag node from Treelist & drop on Diagramv
Reply #2 - Jul 8th, 2011 at 12:01pm
Print Post  
I not able to understand....

How can I add the treelist node in the shapenode of diagramview which is already inserted in the diagramview.

(I easily add the treelist node in the link (drop here) & write a text in shapenode but I want add this treelist node in the shapenode which is drag from listbox.)

Please give me any example or code!..

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag node from Treelist & drop on Diagramv
Reply #3 - Jul 8th, 2011 at 2:52pm
Print Post  
If you need to handle drop events over nodes, copy LinkFromDragEvent and modify it to return nodes:

Code
Select All
private DiagramNode NodeFromDragEvent(DragEventArgs e)
{
	// DragEventArgs gives us the screen coordinates of a point
	// so convert them to the diagram logical coordinate system
	Point clientPoint = view.PointToClient(new Point(e.X, e.Y));
	PointF diagramPoint = view.ClientToDoc(clientPoint);

	return diagram.GetNodeAt(diagramPoint);
} 



and update view_DragOver and view_DragDrop to handle the case when the user drags a treelist over a node. After adding the tree node to the diagram, you can attach it to the ShapeNode by calling treeNode.AttachTo(shapeNode).
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint