Silverlight Binding Height to its parent element is not working
<local:CustomDataGrid Grid.Row="0" Height="200"
IsReadOnly="True" x:Name="dgCaseHistory"
AutoGenerateColumns="False">
<local:CustomDataGrid.RowDetailsTemplate>
<DataTemplate>
<Grid Background="Black" Height="{Binding ElementName=dgCaseHistory, Mode=TwoWay,Path=Height}">
<TextBlock Text="testestestest" />
</Grid>
</DataTemplate>
</local开发者_运维问答:CustomDataGrid.RowDetailsTemplate>
</local:CustomDataGrid>
Try binding to the ActualHeight
property.
<Grid Height="{Binding ElementName=dgCaseHistory, Mode=TwoWay, Path=ActualHeight}">
<TextBlock Text="testestestest" />
</Grid>
If not, check the Output Window in Visual Studio for any DataBinding errors and update your question with those details.
精彩评论