Bonjour,

Est il possible de faire un master detail avec 2 datagrid et du binding sans passer par du code evenementiel("selectionchanged").

J'ai essayer de reproduire un exemple en WPF de Mitsu , mais ca n'a pas l'air de fonctionner , y aurais t'il une erreur ou une autre solution ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<DataGrid  Height="300" Width="600" x:Name="dg" ItemsSource="{Binding}" >
 
 </DataGrid>
 
 <DataGrid Height="300" Width="600" Name="dg2"ItemsSource="{Binding  ElementName=dg,Path=SelectedItem.gestion}">
 
 </DataGrid>
 
 
 
PagedCollectionView pg;
 
void ser_GetproductCompleted(object sender, SLV.ServiceReference1.GetproductCompletedEventArgs e)
 {
            ServiceReference1.produit p = new SLV.ServiceReference1.produit();
 
            pg = new PagedCollectionView(e.Result);
 
            DataContext  = pg ;
 
 }
Table parent Produit , table enfant gestion

Merci.