【问题标题】:Telerik RadDiagram TreeLayout not showing in a gridTelerik RadDiagram TreeLayout 未在网格中显示
【发布时间】:2013-07-15 23:38:24
【问题描述】:

我正在尝试创建一个类似于here的图表

我有这样的 xaml 代码:

<Border Grid.Row="1" Margin="0 4 0 0" Background="White" BorderBrush="#FFD6D4D4" BorderThickness="0 0 1 1">
            <Grid>
                <Border BorderThickness="1 1 0 0" BorderBrush="#D6D6D6" />

                <telerik:RadDiagram x:Name="diagram" GraphSource="{Binding GraphSource}"
                            ScrollViewer.HorizontalScrollBarVisibility="Visible"
                            ScrollViewer.VerticalScrollBarVisibility="Visible"
                            Zoom="{Binding ZoomFactor, Mode=TwoWay, Source={StaticResource repGpDataInstance}}" Height="800" />
            </Grid>
        </Border>

在我后面的代码中,我执行以下操作:(在初始化组件之后...等)

this.treeLayout.Layout(this.diagram, mymodel.ChildTreeLayoutViewModel.CurrentLayoutSettings);

即使布局类型设置为 TreeDown,我也将所有节点都放在彼此的顶部,但看不到树结构。我怎样才能以正确的方式做到这一点?我需要通过ObservableCollection&lt;Object&gt; 提供的节点的树结构

【问题讨论】:

标签: silverlight xaml telerik telerik-grid


【解决方案1】:

对于此类问题,您基本上有两种选择:

  1. 为设置形状默认宽度和高度的形状添加样式。如果这不能很好地满足您的场景:
  2. 尝试在 Dispatcher.BeginInvoke 中调用布局

Dispatcher.BeginInvoke(() => this.treeLayout.Layout(...)

【讨论】:

    猜你喜欢
    • 2018-12-23
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多