Dropping Items in my Customized RadDiagramContainerShape doesn't work

8 posts, 0 answers
  1. Alaa
    Alaa avatar
    27 posts
    Member since:
    Jun 2014

    Posted 16 Feb 2015 Link to this post

    I made a custom shape contains only RadDiagramContainerShape. It's a new control in my gallery.
    I drag it from my toolbar and drop it to the diagram.
    But when try to drop them inside it, it does not hosting any shape when!
    What I have to do?

    Thank you.
  2. Alaa
    Alaa avatar
    27 posts
    Member since:
    Jun 2014

    Posted 17 Feb 2015 in reply to Alaa Link to this post

    I need a solution for this!
    I think I need to handle manually DragOver &  Drop Events for the RadDiagramContainerShape, and this is what I did like the following

    private void DiagramItemsChanged(object sender, DiagramItemsChangedEventArgs args)
    {
                EventManager.RegisterClassHandler(typeof(MyContainer), RadDiagramShape.DragOverEvent, new System.Windows.DragEventHandler(OnDragOver));
                EventManager.RegisterClassHandler(typeof(MyContainer), RadDiagramShape.DropEvent, new System.Windows.DragEventHandler(OnDrop));
    //.......}

     It hits the OnDragOver but didn't hit OnDrop! 
  3. UI for WPF is Visual Studio 2017 Ready
  4. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 19 Feb 2015 Link to this post

    Hi Alaa,

    I am writing to notify you that we are currently working on this case. We will get back to you as soon as we have more information to share.

    Regards,
    Pavel R. Pavlov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 19 Feb 2015 Link to this post

    Hello,

    It does not become clear what might be causing this issue. You can take a look at our online help topic about Drag and Drop support to help you understand how the drag and drop works.

    RadDiagram relies on its Serialization feature when you perform drag and drop operations. This is why I suggest using it instead of implementing custom dropping logic. You can do this by using the ISerializationService

    I demonstrated how this can be achieved in the attached project.


    Regards,
    Peshito
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Alaa
    Alaa avatar
    27 posts
    Member since:
    Jun 2014

    Posted 22 Feb 2015 in reply to Peshito Link to this post

    @Peshito
    I tried this but it didnt work!
  7. Alaa
    Alaa avatar
    27 posts
    Member since:
    Jun 2014

    Posted 22 Feb 2015 Link to this post

    @Pavel R. Pavlov, Please notify me when you find a solution.

    Guys, what I need is a container for my custom shapes looks like callout.
    What I did now, after my previous attempts didn't work is
    I created a class inherits from RadDiagramContainerShape, and created a ResourceDictionary for the template, it contains a path of the callout!
    But Now, I got a problem. The connector don't appear even they are serializing in my file.
    please, look at the attached image, you won't find any connector!
  8. Alaa
    Alaa avatar
    27 posts
    Member since:
    Jun 2014

    Posted 23 Feb 2015 Link to this post

    My last problem has been solved by this reply 

    The idea is add the ItemsSource to the ConnectorsControl
  9. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 23 Feb 2015 Link to this post

    Hi Alaa,

    I am glad you managed to solve the connectors issue. As for the drag and drop problem you are having when custom shapes are used, could you please send us a sample runnable project pointing it out. Without your implementation it is hard to give you a possible solution. As this is a forum thread you should use a third party website for files upload.

    Regards,
    Peshito
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready