This is a migrated thread and some comments may be shown as answers.

Handle Paste from external application

3 Answers 19 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Kent
Top achievements
Rank 1
Kent asked on 14 Jan 2014, 07:19 PM
I am having issue where a user pastes item like text or image from external application into a diagram.

When the user does this it adds an item to the diagram with text saying "Telerik.Windows.Controls.Diagram.Extensions.ViewModels.NodeViewModelBase".

How can I handle the paste action so it only pastes items onto the diagram that are valid Telerik diagram items?
And maybe allow pasted text from other applications but not anything else like images?

3 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 17 Jan 2014, 08:06 AM
Hi Kent,

I am not sure that I fully understand your custom scenario. Could you please elaborate more on your current implementation? Are you using the NodeViewModelBase class in a GraphSource in your application?

Also, it would be helpful if you clarify what you need to paste (string, image...) and where you need to paste it from. Are you using the serialization feature of the RadDiagram? What you have in mind when you say "valid Telerik diagram items"? Do you have any validation of the items or you need to visualize RadDiagramShapes with the pasted string set as content?

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Kent
Top achievements
Rank 1
answered on 17 Jan 2014, 04:03 PM
I am using the NodeViewModelBase class. I am extending SerializableGraphSourceBase  and using it as the GroaphSource of the diagram.

What I like to paste text from notepad or word into the diagram.  When I say a valid Telerik diagram items I meant just items that are on the diagram.  There is no validation needed.  When I paste text from another place like notepad I would like to show on the diagram.

Hope this clarifies my current scenario.

0
Pavel R. Pavlov
Telerik team
answered on 22 Jan 2014, 12:58 PM
Hello Kent,

Unfortunately, the RadDiagram control does not support this functionality out of the box. However, you can easily achieve your requirement by overriding the CreateNode() method of your custom GraphSource. I am happy to inform you that this approach is demonstrated in the MVVM project of our XAML SDK.

Please take a look at it and let us know if you need any further assistance.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Diagram
Asked by
Kent
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Kent
Top achievements
Rank 1
Share this question
or