I cannot see my connectors?

4 posts, 0 answers
  1. Kristoffer
    Kristoffer avatar
    30 posts
    Member since:
    Oct 2012

    Posted 17 Dec 2012 Link to this post

    I've created a project based on your "OrgChart" sample. I'm trying to modify it so that I can see some connectors on the nodes, but I can't figure it out. Also, I need to add the connectors programmatically. How can I accomplish this?

    So far I have this (for the shapes in the diagram toolbox). Not sure if this is right...

    var shape = new RadDiagramShape();

    shape.Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.RectangleShape);

    double offset = 0.25;

    foreach (var c in connections)

    {

        var connector = new RadDiagramConnector() { Name = name };

        connector.Offset = new Point(1.0, offset);

        offset += 0.25;

        shape.Connectors.Add(connector);

    }

    var galleryItem = new GalleryItem(displayName, shape, category);

    gallery.Items.Add(galleryItem);

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 20 Dec 2012 Link to this post

    Hi Kristoffer,

    In the OrgChart sample, we have intentionally hidden the connectors by setting the RadDiagram.IsConnectorsManipulationEnabled property to False. So if you need to display the connectors, you'll have to  set this property back to True in the RadDiagram style.

    Also, your code snippet looks correct but as we're not sure what is your exact logic, I'm not sure if it works as you expect it to. However, please note that by default the RadDIagramShape connectors are displayed only when activated - this means that a shape connector is displayed only when a connection will be build from it. In case you need to display the connectors of the shapes at all times, you'll have to edit the default ControlTemplate of the RadDiagramShape to display the connectors container.

    I hope this information will help you but if we're missing something, please let me know.

    Kind regards,
    Tina Stancheva
    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
    30 posts
    Member since:
    Oct 2012

    Posted 20 Dec 2012 Link to this post

    Thanks for your answer,

    I do have this in my style: <Setter Property="IsConnectorsManipulationEnabled" Value="True" />

    My exact logic is described below. However, I would be happy if I could just get a connector to show up at some time :)

    My diagram nodes are generated from code. Each node has an arbitrary number of incoming and outgoing connectors (usually just one). My for-loop attempts to populate the connectors vertically at y-position 0.25, 0.50, 0.75... The code runs, but the connectors are never visible. Do I need to re-add the connection points when the shape is dropped on my diagram surface? (The code I posted does this for the toolbox items.)
  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 26 Dec 2012 Link to this post

    Hello Kristoffer,

    As far as I understand you need to create some connections starting from the same point/connector and ending at some coordinates. This can be achieved by setting the Source property of the RadDiagramConnection to one point of all connections and setting the EndPoint property of the same connection to a Point as shown in the attachment. Please take a look at the attached project and let me know if I have missed something.

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top