2016-05-04 76 views
2

我在我的WPF印版一個DataGrid Etudiant我需要顯示時Etudiant連續單擊名爲Epreuve其他DataGrid和同樣的工作,以顯示名爲Module其他數據網格當選擇行在Epreuve,我需要的情況下,以填補其顯示DataGrid中當點擊一行

回答

1

填補了內部數據網格,您可以使用LoadingRowDetails事件

<DataGrid x:Name="Condidat" IsReadOnly="True" LoadingRowDetails="Condidat_LoadRowDetails" CanUserReorderColumns="True" CanUserResizeColumns="True" CanUserResizeRows="False" CanUserSortColumns="True" HorizontalAlignment="Left" Margin="288,48,0,0" VerticalAlignment="Top" Height="345" Width="652"> 
     <DataGrid.RowDetailsTemplate> 
      <DataTemplate> 
       <DataGrid x:Name="Epreuve" AutoGenerateColumns="True" IsReadOnly="True" LoadingRowDetails="Epreuve_LoadRowDetails" CanUserAddRows="True" CanUserDeleteRows="True" CanUserReorderColumns="True" CanUserResizeColumns="True" CanUserSortColumns="True" CanUserResizeRows="False" RowDetailsVisibilityMode="VisibleWhenSelected"> 
        <DataGrid.RowDetailsTemplate> 
         <DataTemplate> 
          <DataGrid x:Name="Module" IsReadOnly="True" AutoGenerateColumns="True" CanUserAddRows="True" CanUserDeleteRows="True" CanUserReorderColumns="True" CanUserResizeColumns="True" CanUserSortColumns="True" CanUserResizeRows="False" RowDetailsVisibilityMode="VisibleWhenSelected"/> 
         </DataTemplate> 
        </DataGrid.RowDetailsTemplate> 
       </DataGrid> 
      </DataTemplate> 
     </DataGrid.RowDetailsTemplate> 
    </DataGrid>