I have two Expanders in a grid, both in Auto sized rows. When the height of the Expander is very large, the row overflows out of the grid.
Is there a way to have Auto sized rows that take only the grid space that's available?
I have two Expanders in a grid, both in Auto sized rows. When the height of the Expander is very large, the row overflows out of the grid.
Is there a way to have Auto sized rows that take only the grid space that's available?
Try setting the MaxHeight property on either the expander object or the object inside the expander.
You could use a DockPanel instead - and then dock the first Bottom and let the other fill. Or put each Expander inside a ScrollViewer.
i would set the last rowDefinition to Height="*", then the last row fills out all the space left.
but it doesnt help if not only the last row would overflow..
See my custom auto-sizing panel/grid class here. I wrote it specifically to address this problem--full source is in the question.
(To use it, create a new class that inherits from panel and paste the working code into the class, then use the custom class just like a StackPanel.)
It currently only supports Vertical orientation, but could easily be modified to support Horizontal as well.