我有一个 Datagrid,在它的行详细信息模板中我有另一个 Datagrid
<DataGrid Name="dataGridWorkOrders" ItemsSource="{StaticResource workorders}" >
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<Border BorderThickness="0" Background="BlanchedAlmond" Padding="10">
<DataGrid IsReadOnly="True" AutoGenerateColumns="False" ItemsSource="{Element=dataGridWorkOrders,path=selectedItem}">
</DataGrid>
</Border>
工单集合就像:
class WorkOrders : ObservableCollection<WorkOrder>
{
public WorkOrders()
{
var orderList = OrderDetailsProvider.GetOrders() as List<WorkOrder>;
orderList.ForEach(
order => this.Add(order));
}
WorkorderClass 具有以下作为比例公开的字段。
private string orderID;
private int totalQuantity;
private string status;
private ObservableCollection<Schedule> scheduleCollection;
现在在我的第二个数据网格中,我想绑定到当前选定数据网格的ScheduleCollection