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

Dropping Items in my Customized RadDiagramContainerShape doesn't work

7 Answers 95 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Alaa
Top achievements
Rank 1
Alaa asked on 16 Feb 2015, 10:18 AM
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.

7 Answers, 1 is accepted

Sort by
0
Alaa
Top achievements
Rank 1
answered on 17 Feb 2015, 01:36 PM
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! 
0
Pavel R. Pavlov
Telerik team
answered on 19 Feb 2015, 08:18 AM
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.

 
0
Peshito
Telerik team
answered on 19 Feb 2015, 12:17 PM
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.

 
0
Alaa
Top achievements
Rank 1
answered on 22 Feb 2015, 08:29 AM
@Peshito
I tried this but it didnt work!
0
Alaa
Top achievements
Rank 1
answered on 22 Feb 2015, 08:42 AM
@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!
0
Alaa
Top achievements
Rank 1
answered on 23 Feb 2015, 08:51 AM
My last problem has been solved by this reply 

The idea is add the ItemsSource to the ConnectorsControl
0
Peshito
Telerik team
answered on 23 Feb 2015, 11:19 AM
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.

 
Tags
Diagram
Asked by
Alaa
Top achievements
Rank 1
Answers by
Alaa
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Peshito
Telerik team
Share this question
or