开发者

Silverlight Binding Height to its parent element is not working

开发者 https://www.devze.com 2022-12-21 20:20 出处:网络
<local:CustomDataGrid Grid.Row=\"0\"Height=\"200\" IsReadOnly=\"True\"x:Name=\"dgCaseHistory\" AutoGenerateColumns=\"False\">
<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

精彩评论

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