コレクションのコレクションを WPF データグリッド コンポーネント (外部ライブラリ) にバインドしています。基になるコンポーネントDataSource
には次の構造があります。これにより、基本的に階層レコードを持つデータグリッドが得られます
class DataGridItemType
{
public string weightType;
public string SourceType;
private BindingList<DataGridItem> typeCollection = new BindingList<DataGridItem>();
}
BindingList<DataGridItemType> list = new BindingList<DataGridItemType>();
list
は datagrids DataSource であり、これは階層バインディングを実行します。今、私はコンポーネント(データソースがtypeCollectionである階層への1レベルのレコードのヘッダーラベル)をweightType
使用して変数にバインドしようとしましText="{Binding Path=weightType, Mode=TwoWay, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type btm:DataGridItemType}}}
たが、バインドは機能しません。何か不足していますか?