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

Grid not working as expected when having RowDefinition with MaxHeight=X & Height=Auto.

$
0
0

Hello,

 

I'm trying to have a Grid to behave as if its rows are having a Maximum Height but that may still automatically shrink if their content's desiredHeight is smaller.

 

So I tried by creating the RowDefinitions with MaxHeight with desired max height and Height as GridLength.Auto but, to my surprise, if the content's DesiredHeight is greater than the MaxHeight, the Grid will accept it as the ActualHeight of the Row.

So the ActualHeight does not respect the MaxHeight restriction setted on the row.

 

Is this a bug or a feature?

 

In any case, how can I modify it to obtains the desired behavior?

 

Thanks

 

 

Rene Beauchemin


Viewing all articles
Browse latest Browse all 18858

Trending Articles



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