The headerGrid in your Form1 has columns. I set ShowGridLines=True;
, the border is in the cell. So the right side of the Border cannot overlap with the GridLines.
You could try to refer to the layout below.
<Grid Name="headGrid" ShowGridLines="True" Width="200" Height="100">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="form1" Height="20" Width="200" TextAlignment="Center" />
<Grid Grid.Row="1" ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Height="20" TextAlignment="Center" >pattern1</TextBlock>
<TextBlock Height="20" TextAlignment="Center" Grid.Column="1">pattern2</TextBlock>
<TextBlock Height="20" TextAlignment="Center" Grid.Column="2">pattern3</TextBlock>
</Grid>
<Grid Grid.Row="2" ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
</Grid.RowDefinitions>
</Grid>
</Grid>
The picture of result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.