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

e.Connection.Source data not set in ConnectionManipulationStarted?

2 Answers 85 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 08 Jan 2013, 04:44 PM
private void diagram_ConnectionManipulationStarted(object sender, ManipulationRoutedEventArgs e)
{
    MyShape source = e.Connection.Source as MyShape;
    // source.MyData == null?
}

We're trying to add logic for connection manipulation. Why isn't our custom data set in this event when it is indeed set for our nodes in the graph?

2 Answers, 1 is accepted

Sort by
0
Francois
Telerik team
answered on 10 Jan 2013, 03:18 PM
Hello,

 assuming that 'MyData' is a custom property there is no way we change that in the RadDiagram code. The Source property will return the shape where the connection starts and is presumably a custom shape. If the Source of the connection is indeed of type 'MyShape' and its 'MyData' is null, it means you have not set it. If 'source' is null then it means the Source shape is not of the 'MyShape' type, but then you would get an exception trying to access the 'MyData' property on the null instance.
Unless you show only part of the code and there is some more logic/code in the loop?

Regards,
Francois
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kristoffer
Top achievements
Rank 1
answered on 10 Jan 2013, 03:25 PM
You're right. We had to set it in GetShapeContainerForItemOverride(object item)

Thanks.
Tags
Diagram
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Francois
Telerik team
Kristoffer
Top achievements
Rank 1
Share this question
or