e.Connection.Source data not set in ConnectionManipulationStarted?

3 posts, 0 answers
  1. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 08 Jan 2013 Link to this post

    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. Francois
    Admin
    Francois avatar
    10 posts

    Posted 10 Jan 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 10 Jan 2013 Link to this post

    You're right. We had to set it in GetShapeContainerForItemOverride(object item)

    Thanks.
Back to Top