Link to home
Start Free TrialLog in
Avatar of Sid Price
Sid PriceFlag for United States of America

asked on

WPF: Using the expander control

I need to design a user control  that has an expander  at the top of the control that is used to reveal some details about the current page being displayed. Below the expander is a ListView control displaying the content.

This is an outline of the XAML I have right now:

<UserControl>
      <StackPanel>
            <Expander>
                   ... expander content
            </Expander>
            <ListView> .... </ListView>
      </StackPanel>
</UserControl>

Open in new window


The StackPanel is set for vertical mode and the ListView is stretched to fill the space left after the Expander. The issue is that the ListView does not fill the vertical space left.

To try and figure out the problem I made a test application that has a StackPanel with only a ListView in it and the same happens, the ListView does not fill the StackPanel vertically, in spite of being set to stretch.

Is there some way to overcome this please?
Sid.
ASKER CERTIFIED SOLUTION
Avatar of Snarf0001
Snarf0001
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sid Price

ASKER

Perfect! Thank you so much I was unaware of the "Auto" setting, works just as required,
Sid.