Click here to Skip to main content
14,976,314 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to use a gridsplitter:
so when vertical it works:

XML
<Grid Grid.Column="1">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>

    <Border Grid.Column="0" Background="Transparent" BorderBrush="Gainsboro" BorderThickness="3" />
<GridSplitter Grid.Column="1" Width="10"/>
<Border Grid.Column="2" Background="Transparent"  BorderBrush="Gainsboro"  BorderThickness="3"  />
</Grid>


instead when horizontal it doesn't:

XML
<Grid Name="grdReport_RTFBeretta" Grid.Column="1">
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <Border Grid.Row="0" Background="Transparent" BorderBrush="Gainsboro" BorderThickness="3" />
    <GridSplitter Grid.Row="1" Height="10"/>
    <Border Grid.Row="2" Background="Transparent"  BorderBrush="Gainsboro"  BorderThickness="3"  />
</Grid>



Thank you for any help
Patrick

What I have tried:

I have tried to put/change Vertical/HorizontalAlignment="Stretch" but that didn't change anything.
Posted
Updated 12-Jun-21 4:45am

Thanks Richard. I was having the same problem and that article helped.

Essentially, this is a pretty minimal generic setup.

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"  />
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition />
    </Grid.ColumnDefinitions>

    <Label Content="(0,0)" Grid.Row="0" Background="Yellow"/>
    <Label Content="(1,0)" Grid.Row="1" Background="LightBlue"  />
    <Label Content="(0,1)" Grid.Row="0" Grid.Column="1" Background="MediumPurple"  />
    <Label Content="(1,1)" Grid.Row="1" Grid.Column="1" Background="Green"  />

    <GridSplitter Grid.Row="0"
                  Height="10"
                  Grid.ColumnSpan="2"
                  HorizontalAlignment="Stretch"
                  VerticalAlignment="Bottom" />
</Grid>
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900