How to TreeView Node Drag in NDrawingView Drop?


Author
Message
Park yunsin
Park yunsin
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)
Group: Forum Members
Posts: 1, Visits: 1

Hi

How to TreeView Node Drag in NDrawingView Drop?

Failed to create drag drop data preview. Exception was: Null Refrence Error

Mouse Cursor ICon is None

Help Me


Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Take a look at the Drawing View -> Custom Drag and Drop Example that comes with Nevron Diagram for .NET.

Best Regards,
Nevron Support Team


David Dieffenthaler
David Dieffenthaler
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)
Group: Forum Members
Posts: 6, Visits: 4
Nevron Support Team,

I think that the Custom Drag and Drop Example is fine but not very practical for my scenario, I would like to create new NShape when something is dropped in the NDrawingView rather than creating NSHape first and attach them to the .Tag as NMyDataObject

So is there a way to override the DragDrop event?

I tried to to this in the code but it only works on the edges

private void listBox1_MouseDown(object sender, MouseEventArgs e)
{
int index = listBox1.IndexFromPoint(e.X, e.Y);
object s = null;
if (index >= 0)
s = listBox1.Items[index];
if (s != null)
listBox1.DoDragDrop(s, DragDropEffects.Copy);
}
private void nDrawingView1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
}

private void nDrawingView1_DragDrop(object sender, DragEventArgs e)
{
MessageBox.Show("Drop");
}

Result is I can drag and drop in the ruler bars, but I can't drop in the main view area, see attached screenshot (I added the cursors later on the image to reflect how the cursor changes in different areas of the NDrawingView)

My question can be resumed at: Can we override the DragDrop method of the NDrawingView somwhow instead of relying only in the built in features of the control?

Thanks

Attachments
drop.png (303 views, 2.00 KB)
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
You can override the OnDragEnter, OnDragOver, OnDragDrop and OnDragLeave of the NDrawingView and perform custom drag and drop if you want.

However note that you will loose many build in features like drag and drop ghost, auto-scrolling during drag and drop etc.

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search