In my opinion, this is a bug that occurs when at least one of the column defintions is set to a pixel value. If you change your columns definition to a star value, then everything is fine. Check out this modified version of your code:
<Window x:Class="Gridsplitter.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<Grid x:Name="Holdergrid" MaxWidth="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=ActualWidth}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="300" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="400" MinWidth="300" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}"></Button>
<Button Grid.Column="2" Content="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}"></Button>
<GridSplitter Name="GridSplitterFolders" HorizontalAlignment="Center" VerticalAlignment="Stretch" Grid.Column ="1" Width ="5" ResizeBehavior="PreviousAndNext"/>
</Grid>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<TextBlock Text="{Binding ElementName=Holdergrid, Path=ActualWidth, StringFormat=Actual Width: {0}}"></TextBlock>
<TextBlock Text="{Binding ElementName=Holdergrid, Path=Width, StringFormat=Width: {0}}" Margin="10 0 0 0"></TextBlock>
<TextBlock Text="{Binding ElementName=Holdergrid, Path=MaxWidth, StringFormat=Max Width: {0}}" Margin="10 0 0 0"></TextBlock>
</StackPanel>
</Grid>
</Window>
When you drag the grid splitter to the left side, the right column will grow somewhat indefinitely, even exceeding the MaxWidth that I restricted. If you replace Width="400"
with Width="*"
on the third column definition, it works correctly. Obviously, that is the only way to make it work.