Profile Picture

How to TreeView Node Drag in NDrawingView Drop?

Posted By Park yunsin 12 Years Ago
Author
Message
Park yunsin
questionmark Posted 12 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 12 Years Ago
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
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
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
Posted 10 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 10 Years Ago
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 (287 views, 2.00 KB)
Nevron Support
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
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





Similar Topics


Reading This Topic