I have DataGrids that are getting resized when certain Grids are collapsed. In the default scenario, I’d like to have two rows in a column be like this:
<Grid.RowDefinitions>
<RowDefinition Height="0.65*"/>
<RowDefinition Height="0.35*"/>
</Grid.RowDefinitions>
When I resize in the code behind, I seem to only have the option for the height/widths to be of type:
.RowDefinitions[i].Height = GridLength.Auto;
.ColumnDefinitions[i].Width = new GridLength(1, GridUnitType.Star);
Is there a way I can revert back to my original .65* and .35*? Thanks.
.65*can be written asnew GridLength(.65, GridUnitType.Star);The first parameter in the
GridLengthconstructor is the number in front of the*, andHeight="*"is reallyHeight="1*"