Note that there are some explanatory texts on larger screens.

plurals
  1. POExpander not stretchable
    primarykey
    data
    text
    <p>I have a WPF application, and I use expanders. When I make the expander collapse, it keeps occupying the space. Is it possible to make it free the space, in xaml?</p> <p>Here is some code:</p> <pre><code> &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition Height="3*"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition Height="4*"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition Height="2*"&gt;&lt;/RowDefinition&gt; &lt;/Grid.RowDefinitions&gt; &lt;wpfx:BusyIndicator Name="BusyBar" IsBusy="{Binding IsBusy}" BusyContent="Uploading enrollment data..." Grid.Row="0" /&gt; &lt;Expander Grid.Row="1" IsExpanded="True" Header="Enrollment Files Upload"&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition Height="*"&gt;&lt;/RowDefinition&gt; &lt;/Grid.RowDefinitions&gt; &lt;StackPanel Orientation="Horizontal" Margin="3, 10" Grid.Row="0"&gt; &lt;TextBlock Text="Agencies:" VerticalAlignment="Center" /&gt; &lt;ComboBox x:Name="Agencies" DisplayMemberPath="PrimaryName" SelectedValuePath="AgentId" SelectedItem="{Binding SelectedAgency}" MinWidth="100" Margin="3,0,10,0" VerticalAlignment="Center" /&gt; &lt;TextBlock Text="Worksheet:" VerticalAlignment="Center" /&gt; &lt;TextBox x:Name="WorkSheetName" VerticalAlignment="Center" Margin="3,0,10,0" /&gt; &lt;Button x:Name="UploadFile" MinWidth="70" Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" attachProperties:ButtonIcon.Icon="Resources/Images/add.png" Content="Upload File" IsEnabled="{Binding EnrollmentFiles.Any}" Style="{StaticResource ImageButtonStyle}" /&gt; &lt;Button x:Name="EnrollmentDelete" MinWidth="70" Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" attachProperties:ButtonIcon.Icon="Resources/Images/Remove.png" Content="Delete Enrollment" IsEnabled="{Binding EnrollmentFiles.Any}" Style="{StaticResource ImageButtonStyle}" /&gt; &lt;/StackPanel&gt; &lt;c1:C1FlexGrid x:Name="EnrollmentFiles" Grid.Row="1" AutoGenerateColumns="False" IsReadOnly="True" Width="Auto" ItemsSource="{Binding Path=EnrollmentFiles}" SelectionMode="Row" KeepCurrentVisible="True" SelectedItem="{Binding Path=SelectedEnrollmentFile, Mode=TwoWay}"&gt; ... &lt;/c1:C1FlexGrid&gt; &lt;/Grid&gt; &lt;/Expander&gt; &lt;Expander Grid.Row="2" IsExpanded="True" Header="First Data Entry Records"&gt; &lt;DataGrid x:Name="FirstEntries" AutoGenerateColumns="False" BaseControls:DataGridExtension.Columns="{Binding FirstEntryGridColumns}" CanUserAddRows="False" IsReadOnly="True" SelectedItem="{Binding Path=SelectedFirstEntry}"&gt; ... &lt;/DataGrid&gt; &lt;/Expander&gt; &lt;Expander Grid.Row="3" IsExpanded="True" Header="Enrollment Files Upload"&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt; &lt;RowDefinition&gt;&lt;/RowDefinition&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="Auto"&gt;&lt;/ColumnDefinition&gt; &lt;ColumnDefinition Width="Auto"&gt;&lt;/ColumnDefinition&gt; &lt;ColumnDefinition Width="Auto"&gt;&lt;/ColumnDefinition&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;StackPanel Orientation="Horizontal" Grid.Row="0" Grid.ColumnSpan="3" Margin="3,10"&gt; ... &lt;/StackPanel&gt; &lt;TextBlock x:Name="SelectedFirstEntry_NameOnAccount" Grid.Row="1" Grid.Column="0" /&gt; &lt;TextBlock x:Name="SelectedFirstEntry_AccountNo" Grid.Row="1" Grid.Column="1" Margin="3,0" /&gt; &lt;TextBlock x:Name="SelectedFirstEntry_MeterNo" Grid.Row="1" Grid.Column="2" Margin="3,0"/&gt; &lt;DataGrid x:Name="Findings" Grid.Row="2" AutoGenerateColumns="False" BaseControls:DataGridExtension.Columns="{Binding FindingsGridColumns}" CanUserAddRows="False"&gt; ... &lt;/DataGrid&gt; &lt;/Grid&gt; &lt;/Expander&gt; &lt;/Grid&gt; </code></pre> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload