I have a DataGrid in my WPF forme Etudiant
i need to show other datagrid when a row in Etudiant
is clicked named Epreuve
and the same work to display other datagrid named Module
when a row is selected in Epreuve
and i need the event to fill it
2
votes
1 Answers
1
votes
to fill the inside datagrid you can use LoadingRowDetails Event
<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>