views:

124

answers:

1

I`m trying to fill whole content of Layout with TreeView control. But I cant get height property to stretch. Here is part of the code:

<Grid Grid.Column="0" Margin="2,2,2,0" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <dataInput:Label Content="{Binding ConverterParameter=TXT_ORG_JEDINICE, Converter={StaticResource Localization}, Source={StaticResource Localization}}" Style="{StaticResource PerspektivaHeader}"/>
        <basics:TreeView Grid.Row="1" Height="Auto"/>

</Grid>
A: 

Height="Auto" is the default, so it shouldn't be necessary to specify that. To make a control stretch vertically you would usually use VerticalAlignment="Stretch" but again, that is the default, so you don't need to write that explicitly.

How are you making sure that the TreeView is not filling the space as you expect? For example, if you set <TreeView Background="Blue"/> what do you see?

Another question: is this the built in Silverlight tree view, or one from a third party?

Finally, could you show us the XAML surrounding the Grid, as it's possible the problem lies there.

Samuel Jack
Looks like the Toolkit Treeview, there isn't a builtin one.
AnthonyWJones
@Anthony: to my mind, built-in = Silverlight BCL + Toolkit :-)
Samuel Jack
When Background="Blue" only 24 pixels are Blue. This is standard toolkit TreeView. About XAML it is rather big, as this is part of one very complex layout. I don`t think that surrounding XAML is problem.
zidane
@zidane: I suggest you test that theory by placing the above XAML in a usercontrol of its own, give some sensible data. If it still fails to display properly post that XAML. However I suspect you will find that it is the surrounding XAML that is the problem simply because there isn't anything wrong what you've posted so far.
AnthonyWJones