1

I would like to have an expander at the bottom which should be resizable via a grid splitter .

But not with auto height in the content (because the included data grid will need the whole window).

What is the resolution?

My Code: ...

<Expander Grid.Row="1" ExpandDirection="Up" IsExpanded="True">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition MinHeight="4" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <GridSplitter Grid.Row="0" Height="4" ResizeDirection="Rows"
                                                HorizontalAlignment="Stretch" VerticalAlignment="Top" ResizeBehavior="CurrentAndNext"/>
                <DataGrid .../>
            </Grid>

I also tried to set the Maximum Height of the RowDefinition --> The content will not be stretched after resizing the GridSplitter.

4

1 回答 1

0

我使用下面的代码来解决这个问题:

<Grid>.RowDefinitions[1].Height = new GridLength(100, GridUnitType.Pixel);
于 2013-07-19T08:56:42.143 回答