This is a migrated thread and some comments may be shown as answers.

Expander does not push the controls down when expanded

2 Answers 452 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Avinash
Top achievements
Rank 1
Avinash asked on 13 Jun 2015, 09:08 AM

Hi, 

 I added couple expanders inside a stackPanel. But my stackPanel takes up full height into consideration, irrespective of Expander's state. Kindly help me figure out what I missed on Expander's setting.

<ScrollViewer Grid.Row="1" Panel.ZIndex="5">
    <Grid x:Name="MainArea" VerticalAlignment="Top">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <StackPanel CanVerticallyScroll="True" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <telerik:RadExpander x:Name="ReportSection" Height="120" Margin="10,10,10,10" VerticalAlignment="Top" FontFamily="Trebuchet MS" Foreground="#FF0081A7" Header="Report Section Name" BorderBrush="#FF0081A7" BorderThickness="1">
                <telerik:RadExpander.Content>
                    <StackPanel>
                        <CheckBox x:Name="AddToReport" Content="ADD TO REPORT" HorizontalAlignment="Left" VerticalAlignment="Top" Width="150" Height="30" VerticalContentAlignment="Center" BorderBrush="#FF0081A7" Foreground="#FF0081A7" IsChecked="True" FontFamily="Trebuchet MS" />
                        <telerik:RadRichTextBox x:Name="radRichTextBox" DocumentInheritsDefaultStyleSettings="True" Height="auto" HorizontalScrollBarVisibility="Hidden" IsSelectionMiniToolBarEnabled="True" IsSpellCheckingEnabled="True" IsContextMenuEnabled="True" Margin="10" VerticalScrollBarVisibility="Auto" Width="Auto"/>
                    </StackPanel>
                </telerik:RadExpander.Content>
            </telerik:RadExpander>
            <telerik:RadExpander x:Name="ReportSection2" Height="120" Margin="10,10,10,10" VerticalAlignment="Top" FontFamily="Trebuchet MS" Foreground="#FF0081A7" Header="Report Section Name" BorderBrush="#FF0081A7" BorderThickness="1" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" RenderTransformOrigin="0.493,0.856">
                <telerik:RadExpander.Content>
                    <StackPanel>
                        <CheckBox x:Name="AddToReport2" Content="ADD TO REPORT" HorizontalAlignment="Left" VerticalAlignment="Top" Width="150" Height="30" VerticalContentAlignment="Center" BorderBrush="#FF0081A7" Foreground="#FF0081A7" IsChecked="True" FontFamily="Trebuchet MS" />
                        <telerik:RadRichTextBox x:Name="radRichTextBox2" DocumentInheritsDefaultStyleSettings="True" Height="auto" HorizontalScrollBarVisibility="Hidden" IsSelectionMiniToolBarEnabled="True" IsSpellCheckingEnabled="True" IsContextMenuEnabled="True" Margin="10" VerticalScrollBarVisibility="Auto" Width="Auto"/>
                    </StackPanel>
                </telerik:RadExpander.Content>
            </telerik:RadExpander>
            <telerik:RadExpander x:Name="ReportSection3" Height="120" Margin="10,10,10,10" VerticalAlignment="Top" FontFamily="Trebuchet MS" Foreground="#FF0081A7" Header="Report Section Name" BorderBrush="#FF0081A7" BorderThickness="1">
                <telerik:RadExpander.Content>
                    <StackPanel>
                        <CheckBox x:Name="AddToReport3" Content="ADD TO REPORT" HorizontalAlignment="Left" VerticalAlignment="Top" Width="150" Height="30" VerticalContentAlignment="Center" BorderBrush="#FF0081A7" Foreground="#FF0081A7" IsChecked="True" FontFamily="Trebuchet MS" />
                        <telerik:RadRichTextBox x:Name="radRichTextBox3" DocumentInheritsDefaultStyleSettings="True" Height="auto" HorizontalScrollBarVisibility="Hidden" IsSelectionMiniToolBarEnabled="True" IsSpellCheckingEnabled="True" IsContextMenuEnabled="True" Margin="10" VerticalScrollBarVisibility="Auto" Width="Auto"/>
                    </StackPanel>
                </telerik:RadExpander.Content>
            </telerik:RadExpander>
            <telerik:RadExpander x:Name="ReportSection4" Height="120" Margin="10,10,10,10" VerticalAlignment="Top" FontFamily="Trebuchet MS" Foreground="#FF0081A7" Header="Report Section Name" BorderBrush="#FF0081A7" BorderThickness="1">
                <telerik:RadExpander.Content>
                    <StackPanel>
                        <CheckBox x:Name="AddToReport4" Content="ADD TO REPORT" HorizontalAlignment="Left" VerticalAlignment="Top" Width="150" Height="30" VerticalContentAlignment="Center" BorderBrush="#FF0081A7" Foreground="#FF0081A7" IsChecked="True" FontFamily="Trebuchet MS" />
                        <telerik:RadRichTextBox x:Name="radRichTextBox4" DocumentInheritsDefaultStyleSettings="True" Height="auto" HorizontalScrollBarVisibility="Hidden" IsSelectionMiniToolBarEnabled="True" IsSpellCheckingEnabled="True" IsContextMenuEnabled="True" Margin="10" VerticalScrollBarVisibility="Auto" Width="Auto"/>
                    </StackPanel>
                </telerik:RadExpander.Content>
            </telerik:RadExpander>
        </StackPanel>
    </Grid>
</ScrollViewer>

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 15 Jun 2015, 03:43 PM
Hello Avinash,

The described behavior is expected due the fact that the RadExpander controls have their Height property set. If you want to display only the header when the expander is collapsed you can remove the Height set (this will change it to Auto as its default value) and instead set the Height of the expander's Content.

Please try this and let me know if this helps.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Avinash
Top achievements
Rank 1
answered on 16 Jun 2015, 06:52 AM
Thanks. It works flawlessly now. 
Tags
Expander
Asked by
Avinash
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Avinash
Top achievements
Rank 1
Share this question
or