GridSplitter无法拖动

时间:2014-08-05 15:59:52

标签: wpf xaml gridsplitter

我有一个网格,其中包含一个分割器和两个TreeVeiw。

我无法让分离器移动并重新调整两个树的大小。我已尝试更改相关问题的一些选项,但这些都没有帮助。我做错了什么?

        <Grid 
            Grid.Column="0" 
            HorizontalAlignment="Stretch" 
            Name="grid2" 
            VerticalAlignment="Stretch" 
            Background="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TreeView 
                Grid.Row="0"
                Height="Auto"
                HorizontalAlignment="Stretch"
                Name="treeView1"
                VerticalAlignment="Stretch"
                Width="Auto" />
            <GridSplitter 
                Grid.Row="1"
                Grid.RowSpan="2"
                ResizeDirection="Rows"
                Height="5"
                HorizontalAlignment="Stretch"
                Name="gridSplitter2"
                VerticalAlignment="Top"
                Width="Auto"
                ResizeBehavior="PreviousAndNext" />
            <TreeView 
                Grid.Row="2"
                Height="Auto"
                HorizontalAlignment="Stretch"
                Name="treeView2"
                VerticalAlignment="Stretch"
                Width="Auto" />
        </Grid>

1 个答案:

答案 0 :(得分:0)

正如Novitch S所说,我只需要从GridSplitter中删除Grid.RowSpan。