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

How to exclude some shapes from layout ?

2 Answers 98 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Sungwoo
Top achievements
Rank 1
Sungwoo asked on 06 May 2015, 02:34 AM

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);

 

Regards,

Sungwoo

2 Answers, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 07 May 2015, 08:26 AM
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
Telerik
 

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

 
0
Sungwoo
Top achievements
Rank 1
answered on 11 May 2015, 01:57 AM
Thanks !  It works for me without side effect.
Tags
Diagram
Asked by
Sungwoo
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Sungwoo
Top achievements
Rank 1
Share this question
or