同様の質問がありますが、間違っています。XAMLでDataContextが正しく設定されている
は私が持っている:
<DataGrid Name="gridStudents" ItemsSource="{Binding Source={StaticResource cvsStudentList}}"
Margin="2"
Height="250"
AutoGenerateColumns="False" IsReadOnly="True">
しかし、私はそれが正しいもはやであるとは思わない:
<Window.Resources>
<local:StudentList x:Key="StudentList" />
<local:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<local:StudentAssignmentToStudentAssignmentLookup x:Key="LookupHistoryConvertor" />
<CollectionViewSource x:Key="cvsStudentList" Source="{StaticResource StudentList}" Filter="CollectionViewSource_Filter"/>
</Window.Resources>
<Window.DataContext>
<local:OCLMEditorModel/>
</Window.DataContext>
Futherダウン私のマークアップで私はDataGrid
を持っています。私のOCLMEditorModelオブジェクトは、公開プロパティStudentList
と呼ばれています。私がこの権利を理解している場合、現時点では私のウィンドウはOCLMEditorModel
というインスタンスに関連付けられています。ただし、後続のDataGridは、の別の CollectionViewSourceのインスタンスに関連付けられています。
私は混乱しています。ガイダンスをありがとう。
ありがとうございます。私はこれを試して、あなたに戻ってきます。 –
これを行うと、StudentListがWPFでサポートされていないことがわかります。 –
私はバインディングワードを忘れていました。しかし、私のグリッドはデータを表示しません。 –