Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8966345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:00:26+00:00 2026-06-15T17:00:26+00:00

I have a 5 column layout. The aim is to have 3 main columns,

  • 0

I have a 5 column layout. The aim is to have 3 main columns, (left, middle, right) which I could then expand and shrink. To achieve this I added two extra columns which contains the splitters. One between the left and middle column and another between middle and right.

After starting the application and moving the first spliter towards the left the last column (right) suddenly snaps all the way to the left, collapsing all three columns. Any suggestions? Thanks

Here’s the XAML:

<Window x:Class="ThreeColumns.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="725">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="auto"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="auto"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Border BorderBrush="Red" BorderThickness="5" Grid.Column="0" Grid.Row="0" CornerRadius="10">
            <TextBlock Text="Left side" FontSize="24"></TextBlock>
        </Border>
        <GridSplitter Background="blue" Width="5" 
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch" Grid.Column="1"></GridSplitter>
        <Border BorderBrush="Red" BorderThickness="5" Grid.Column="2" Grid.Row="0" CornerRadius="10">
            <TextBlock Text="Middle" FontSize="24"></TextBlock>
        </Border>
        <GridSplitter Background="blue" Width="5" 
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch" Grid.Column="3"></GridSplitter>
        <Border BorderBrush="Red" BorderThickness="5" Grid.Column="4" Grid.Row="0" CornerRadius="10">
            <TextBlock Text="Right side" FontSize="24"></TextBlock>
        </Border>
    </Grid>
</Window>

I managed to solve it by setting the first and last columns width to “auto” and the middle content column to “*”:

<Window x:Class="ThreeColumns.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="725">
    <DockPanel>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition MinWidth="50"  Width="auto" Name="Col1"></ColumnDefinition>
                <ColumnDefinition Width="7" Name="Col2"></ColumnDefinition>
                <ColumnDefinition Name="Col3" Width="*"></ColumnDefinition>
                <ColumnDefinition Width="7" Name="Col4"></ColumnDefinition>
                <ColumnDefinition MinWidth="50" Width="auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Border BorderBrush="Red" BorderThickness="5" Grid.Column="0" Grid.Row="0" CornerRadius="10" Margin="2 2 2 2">
                <TextBlock Text="Left side" Width="250" FontSize="24"></TextBlock>
            </Border>

            <Border BorderBrush="Red" BorderThickness="5" Grid.Column="2" Grid.Row="0" CornerRadius="10" Margin="2 2 2 2">
                <TextBlock Text="Middle" FontSize="24"></TextBlock>
            </Border>
            <Border BorderBrush="Red" BorderThickness="5" Grid.Column="4" Grid.Row="0" CornerRadius="10" Margin="2 2 2 2">
                <TextBlock Text="Right side" Width="250" FontSize="24"></TextBlock>
            </Border>
            <GridSplitter Background="blue" Width="5" 
                      HorizontalAlignment="Center" ResizeDirection="Columns"
                      VerticalAlignment="Stretch" Grid.Column="1" Grid.ZIndex="1"/>
            <GridSplitter Background="blue" Width="5" 
                      HorizontalAlignment="Center" ResizeDirection="Columns"
                      VerticalAlignment="Stretch" Grid.Column="3" Grid.ZIndex="1"/>
        </Grid>
    </DockPanel>
</Window>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:00:28+00:00Added an answer on June 15, 2026 at 5:00 pm

    Your code works for me.
    But I find it cleaner to use fixed width for the splitter and center it.
    It the splitter is against the next column sometimes it seems to wack out.

    Often need to use Auto for all but one.
    If you try something like 2* 3* for relative sizing things often go bad.
    If you want even sizing to start sometimes multiple single * will work.

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto></ColumnDefinition>
                <ColumnDefinition Width="7"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="7"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Border BorderBrush="Red" BorderThickness="5" Grid.Column="0" Grid.Row="0" CornerRadius="10">
                <TextBlock Text="Left side" FontSize="24"></TextBlock>
            </Border>
            <GridSplitter Background="blue" Width="3" 
                          HorizontalAlignment="Center"
                          VerticalAlignment="Stretch" Grid.Column="1"></GridSplitter>
            <Border BorderBrush="Red" BorderThickness="5" Grid.Column="2" Grid.Row="0" CornerRadius="10">
                <TextBlock Text="Middle" FontSize="24"></TextBlock>
            </Border>
            <GridSplitter Background="blue" Width="3" 
                          HorizontalAlignment="Center"
                          VerticalAlignment="Stretch" Grid.Column="3"></GridSplitter>
            <Border BorderBrush="Red" BorderThickness="5" Grid.Column="4" Grid.Row="0" CornerRadius="10">
                <TextBlock Text="Right side" FontSize="24"></TextBlock>
            </Border>
        </Grid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 3 column layout using table-less design. <div id=main> <div id=left></div> <div
I have a main MasterPage which has a single column layout for the web
I have a two-column layout, sidebar on the left, content on the right. So
Imagine I have a 3 column layout. Left, center and right div . I
I have a MasterPage that is two column layout, left column menu, right column
I have been trying to achieve a two-column layout with CSS where the left
I have a two column layout: http://jsfiddle.net/KqQ42/1/ Now I would like that the left
I want to have a 2 column layout, and have the left column able
I have a two column site layout that has the content of the left
I have a two column css layout. Left container holds the dynatree. It's pulling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.