Home > DeveloperSection > Forums > Automatically resize WPF Grid Column
C G E Mannerheim
C G E Mannerheim

Total Post:29

Posted on    October-14-2013 7:34 AM


 1 Reply(s)
 2877  View(s)
Rate this:
            <RowDefinition Height="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="200"/>
        <!-- Browser -->
        <my:WebControl Visibility="{Binding IsIEVisible,Converter={StaticResource BoolToVisibleconverter}}" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="webControl1">
        <GridSplitter Visibility="{Binding isVisiblePult, Converter={StaticResource BoolToVisibleconverter}}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="5" Grid.RowSpan="2" Grid.Column="1"/>
        <Grid Visibility="{Binding isVisiblePult, Converter={StaticResource BoolToVisibleconverter}}" Grid.Column="2">
                <RowDefinition Height="*"/>
            <ListBox x:Name="ListChannels" Grid.Row="1" SelectedItem="{Binding SelectedChannel}" ItemsSource="{Binding Channels}" FontSize="14" Background="#FFD4ECFF">
                        <TextBlock FontSize="17" Text="{Binding Name}"/>

Aaron Douglas
Aaron Douglas

Total Post:20

Posted on    October-14-2013 7:52 AM

Make the second and third column definitions "Auto", and then set explicit widths on your grid splitter and second Grid. Then when you collapse them the main grid will behave as you require.

Don't want to miss updates? Please click the below button!

Follow MindStick