开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜