Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How Drag & drop Row from tableNode (Read 1334 times)
roberto.bonilla
YaBB Newbies
*
Offline


I'm so Happy

Posts: 14
Joined: May 25th, 2009
How Drag & drop Row from tableNode
Jun 4th, 2009 at 2:20am
Print Post  
I have a tableNode created with some rows but try to create drag & drop effect to take some row from tablenode and put the content of the cell into to textbox in my form

Could Someone give me an example

Thanks in advance

RB ???
??? ??? ??? Embarrassed Embarrassed
  

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How Drag & drop Row from tableNode
Reply #1 - Jun 4th, 2009 at 5:45am
Print Post  
Hi,

This code starts drag-and-drop if the Shift key is down, otherwise it will start the default operation (e.g. creating a link).

Code
Select All
private void diagramView_MouseDown(object sender, MouseEventArgs e)
{
	if ((ModifierKeys & Keys.Shift) != 0)
	{
		PointF mousePosition = diagramView.ClientToDoc(e.Location);
		TableNode table = diagram.GetNodeAt(mousePosition) as TableNode;
		if (table != null)
		{
			int row = 0, col = 0;
			if (table.CellFromPoint(mousePosition, ref row, ref col))
			{
				string text = table[col, row].Text;
				if (diagram.Interaction != null)
					diagram.Interaction.CancelNow();
				DoDragDrop(text, DragDropEffects.Copy);
			}
		}
	}
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
roberto.bonilla
YaBB Newbies
*
Offline


I'm so Happy

Posts: 14
Joined: May 25th, 2009
Re: How Drag & drop Row from tableNode
Reply #2 - Jun 4th, 2009 at 6:30pm
Print Post  
Grin Grin

Thanks Stoyan
  

RB
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint