2014-07-21 28 views
1

我打電話給我的圖上佈局如下方法後,我以編程方式添加的項目:不同方向的圖及其容器

... 

var container2 = new RadDiagramContainerShape() 
{ 
    Content = "Status2", 
    Items = { ... } 
}; 
myDiagram.Items.Add(container2); 

myDiagram.LayoutAsync(settings: new SugiyamaSettings { 
    LayoutContainerChildren = true, 
    Orientation = Telerik.Windows.Diagrams.Core.Orientation.Vertical 
}); 

不過,我在圖中幾個容器,和我

enter image description here

我怎樣才能做到這一點:像他們裏面的物品d像容器本身可以水平,而不是垂直方向的?

回答

0

據Telerik的,在寫它的時候是不可能有兩個佈局的一個圖。但是,有一個解決方法可用。您的佈局圖兩次,第一次與

LayoutContainerChildren = falseOrientation = Orientation.VerticalLayoutContainerChildren = trueOrientation = Orientation.Horizontal

又一遍。

這導致:

enter image description here

http://www.telerik.com/forums/different-orientation-for-container-layout

0

要麼使用XAML,或這個XAML轉換爲C#:

<ItemsControl ItemsSource="{Binding YourItems}"> 
    <ItemsControl.ItemsPanel> 
     <ItemsPanelTemplate> 
      <StackPanel Orientation="Horizontal" /> 
     </ItemsPanelTemplate> 
    </ItemsControl.ItemsPanel> 
</ItemsControl> 
+0

這是一個天然的Orientation屬性。我需要Telerik UI one(見標籤),它通常用於他們算法的佈局設置。 – Edgar

+0

然後問Telerik。 – Sheridan

+0

我試過了,但是他們的論壇有點不活躍:\ – Edgar