Drop a navigation bar item onto a document


Author
Message
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
Hi,
To set the text of the dropped shape you can subscribe to the NodeInserted event of the drawing document's event sink service and set the text to the desired one in the event handler:



document.EventSinkService.NodeInserted += OnNodeInserted;

private void OnNodeInserted(NChildNodeEventArgs args)
{
NShape shape = args.Child as NShape;
if (shape != null)
{
shape.Text = "My Text";
}
}


Best Regards,
Nevron Support Team


Marco Hokke
Marco Hokke
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)
Group: Forum Members
Posts: 2, Visits: 19
Hi,
I am trying to implement drag/drop support for an NDrawingView that is connected to a document.

The object I want to drag onto the document is a NavigationBarItem (from another vendor). I seem to be able to drop it onto the scrollbars of the DrawingView, but not onto the 'canvas' area.
Can you please tell me what I am doing wrong?

This code is implemented for the DragOver
If Not TypeOf e.Data.GetData(e.Data.GetFormats()(0)) Is DevExpress.XtraNavBar.NavBarItemLink Then
            e.Effect = DragDropEffects.None
        Else
            e.Effect = DragDropEffects.Copy
        End If

and it works for an ordinary panel. Of course, the DragOver for the document has different parameters (args rather than e), but the code is of the same structure and intent.

Marco Hokke

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