我尝试执行以下操作,但我在 itemscontrol 中得到了空项目。关系有效,因为我让 itemscontrol 填充了正确数量的项目,但只有空项目。我已经尝试了一切,但无法弄清楚。有人可以帮帮我吗。
<Grid DataContext="{DynamicResource DSDKo}">
<ListBox ItemsSource="{Binding tblOrderMachineConversionCheck}" FontFamily="Arial" FontSize="12" >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel >
<Label Content="{Binding Header}" Width="100" Height="30" Background="Silver"/>
<ItemsControl ItemsSource="{Binding Path='FK_tblOrderMachineConversionSubCheck_tblOrderMachineConversionCheck'}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="25"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Label Grid.Column ="0" Content="{Binding Path=Text}" Height="30" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Width="40" Height="40" Click="Button_Click" HorizontalAlignment="Right" VerticalAlignment="Top" />
</Grid>