How to exclude some shapes from layout ?

3 posts, 0 answers
  1. Sungwoo
    Sungwoo avatar
    3 posts
    Member since:
    Apr 2015

    Posted 05 May 2015 Link to this post

    Hi ,

     I am trying to make background using a custom shape and zoom in/out and pan with other shapes. All seems to work but when I tried to run layout, the background shape also participate in layout. Is there a way to exclude specific shape when doing layout ?


      TreeLayoutSettings layout = new TreeLayoutSettings() { TreeLayoutType = TreeLayoutType.TreeLeft };
      Diagram.Layout(LayoutType.Tree, layout);




  2. Kiril Vandov
    Kiril Vandov avatar
    324 posts

    Posted 07 May 2015 Link to this post

    Hello Sungwoo,

    In order to exclude certain shapes from the Layout of the RadDiagram, you could use the following approach.
    - set the "IgnoreInvisible" property of the TreeLayoutSettings to True
    - then right before you call the Layout, set the Visibility of the shape to Collapsed.
    - restore back the visibility of the shape.

    private void Button_Click(object sender, RoutedEventArgs e)
        shapeToIgnore.Visibility = System.Windows.Visibility.Collapsed;
        TreeLayoutSettings layout = new TreeLayoutSettings() { TreeLayoutType = TreeLayoutType.TreeLeft, IgnoreInvisible = true };
        this.xDiagram.Layout(LayoutType.Tree, layout);
        shapeToIgnore.Visibility = System.Windows.Visibility.Visible;
    Please give the approach a try and let us know if it works for you.

    Kind regards,
    Kiril Vandov

    See What's Next in App Development. Register for TelerikNEXT.

  3. Sungwoo
    Sungwoo avatar
    3 posts
    Member since:
    Apr 2015

    Posted 10 May 2015 in reply to Kiril Vandov Link to this post

    Thanks !  It works for me without side effect.
Back to Top