0

フォームの読み込み時に非表示になっているグリッド内にDataGridがあり、データグリッドの幅をその親にバインドしたいのですが、バインドされていないようです。これはサンプルです。

<Grid  Visibility="Binding....}">
    <DataGrid MaxWidth="{Binding ActualWidth, RelativeSource={RelativeSource  Mode=FindAncestor, AncestorType=Grid  }}"
  .../>
 .
 .
 </Grid>

ここでの問題は何ですか?

4

1 に答える 1

0

このようにしてみてください

AncestorType={x:Type Grid}

それ以外の

AncestorType=Grid

これが役立つことを願っています。

于 2012-07-30T06:51:40.100 に答える