Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Problem - How to dynamically change the size of ListBox in Expander control.

$
0
0

Hello all,

I have a "Height" property problem and I do not know what can I do to solve it. The story is like this:

I have a Window which whole right part is a Grid control. In that Grid on the top I have 3 User Controls - each of them is an Expander with a List Box as Content. List Box have custom Item Template. Expand direction is down.

The idea is that always only one of those three Expanders is expanded and its List Box fills the remaining space of the hosting Grid (i.e. the remaining space of the Window from top to bottom).

I have already done the functionality which collapse all other Expanders when one of them is expanded, but I am not able to make that the upcoming List Box is filling the remaining space. I was really trying a lot of combination with "*", "Auto" values, or additional wrapping controls, but all the time the List Box height is equal to the number of its items - of course when I will set the Height to some fixed value it is not, but this is not my goal.

Anyone have some idea how to make that my List Box will be dynamically resized to the remaining space? Thank you for help.



Viewing all articles
Browse latest Browse all 18858

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>