Margins for RadDiagramContainerShape

2 posts, 1 answers
  1. Wipatel
    Wipatel avatar
    3 posts
    Member since:
    Sep 2014

    Posted 09 Sep 2014 Link to this post


    Is it possible to add margins for container so the connections stops near or with some offset?
    I've tried to:
     1) add margins to container template but then shapes that belong to container are being rendered without noticing that margin (attach 1)
     2) replace connectors for shape with increased offset from all sides but then connection looks pretty awful (attach 2)
    I use OrgTreeRouter and every time something happens with container I call diagram layout with specific settings.
    Is there any other way to get something like attach 3?
  2. Answer
    Martin Ivanov
    Martin Ivanov avatar
    1404 posts

    Posted 12 Sep 2014 Link to this post

    Hi Wipatel,

    As their are some dependencies between the shapes and the connection in the diagram there is not very straight forward approach to set a margin between them except the one with the Connectors of the shape. Basically you can modify the distance between a shape and its connection by changing the value of the Offset property of the shape's Connectors. 

    this.shape1.Connectors["Top"].Offset = new Point(0.5, -0.1);
    this.shape1.Connectors["Bottom"].Offset = new Point(0.5, 1.1);
    this.shape1.Connectors["Left"].Offset = new Point(-0.1, 0.5);
    this.shape1.Connectors["Right"].Offset = new Point(1.1, 0.5);

    If this doesn't work for you, I think calling the diagram Layout() method is okay except in the case when you have a big number of shapes that should be rearranged.

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top