Handle Paste from external application

4 posts, 0 answers
  1. Kent
    Kent avatar
    10 posts
    Member since:
    Jan 2012

    Posted 14 Jan 2014 Link to this post

    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?
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 17 Jan 2014 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kent
    Kent avatar
    10 posts
    Member since:
    Jan 2012

    Posted 17 Jan 2014 Link to this post

    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.

  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 22 Jan 2014 Link to this post

    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 >>
Back to Top