I have a SL4 user control which uses a grid for it’s layout. The grid is as follows:
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition x:Name="LayoutHeaderRow" Height="30"/>
<RowDefinition x:Name="LayoutSubHeaderRow" Height="30"/>
<RowDefinition x:Name="LayoutContentRow" Height="*"/>
<RowDefinition x:Name="LayoutFooterRow" Height="30"/>
</Grid.RowDefinitions>
</Grid>
My question is how do I hide the LayoutSubHeaderRow and it’s contents?
Thanks!
Martin
You’ve added
x:Nameto row definitions but that is not much use to you becauseRowDefinitionelements are not visual elements and do not end up in the visual tree. Hence FindName can’t find them.Your xaml needs to look like this:-
You can use the ordinal position of desired row to pick it out of the
RowDefinitionscollection and manipulate it in code