Bonjour,
Je voudrais afficher dans mon treeview plusieurs types de données.
Déjà voici mon code xaml :
Code xml : 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
22
23
24
25
26
27
28
29
30 <StackPanel.Resources> <sdk:HierarchicalDataTemplate x:Key="ChildTemplate"> <StackPanel Orientation="Horizontal"> <TextBlock Text="Dde congé : " FontWeight="Bold" /> <TextBlock FontStyle="Italic" Text="{Binding Path=DateDebut}" /> </StackPanel> </sdk:HierarchicalDataTemplate> <sdk:HierarchicalDataTemplate x:Key="NameTemplate" ItemsSource="{Binding Path=PERSOMEDICA_DDECONGE}" ItemTemplate="{StaticResource ChildTemplate}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="Contrat : " FontWeight="Bold" /> <TextBlock Text="{Binding Path=ID_Contrat}" FontWeight="Bold" /> <TextBlock Text=" " FontWeight="Bold" /> <TextBlock Text="{Binding Path=PERSOMEDICA_PERSONNEL.TIERS_TIERS.Nom}" FontWeight="Bold" /> <TextBlock Text=" " FontWeight="Bold" /> <TextBlock Text="{Binding Path=PERSOMEDICA_PERSONNEL.TIERS_TIERS.Prenom}" FontWeight="Bold" /> </StackPanel> </sdk:HierarchicalDataTemplate> <sdk:HierarchicalDataTemplate x:Key="Personnel" ItemsSource="{Binding Path=PERSOMEDICA_PERSONNEL}" ItemTemplate="{StaticResource ChildTemplate}"> <StackPanel Orientation="Horizontal"> <Image Height="15" Width="15" Source="/BoursesSuperieures;component/logo.png" /> <TextBlock Text="{Binding Path=PERSOMEDICA_PERSONNEL.TIERS_TIERS.Nom}" FontWeight="Bold" /> <TextBlock Text=" " FontWeight="Bold" /> <TextBlock Text="{Binding Path=PERSOMEDICA_PERSONNEL.TIERS_TIERS.Prenom}" FontWeight="Bold" /> </StackPanel> </sdk:HierarchicalDataTemplate> </StackPanel.Resources> <sdk:TreeView ItemsSource="{Binding PcvContrat}" ItemTemplate="{StaticResource NameTemplate}" x:Name="myTreeView"> </sdk:TreeView>
Cela m'affiche des contrats avec les demandes de congé MAIS je voudrais aussi afficher comme un noeud du treeview le "TIERS_TIERS", ainsi que le lieu de travail du contrat (en plus des demandes de congé).
Partager