-1

I'm new in WPF. Let me explain you what is my case. So I have 3 TreeViews with the same source, my point is, is it possible when I expand one of the the item in the first tree automatically to expand the same element in the other trees? And I have another question how to make every line in the TreeView to be different color?

For example 1, 3, 5, 7 line to be gray, and 2,4,6,8 to be white.

<Grid> 
    <TreeView x:Name="TreeView1" Margin="10,20,10,10" ItemsSource="{Binding Groups}" ItemTemplate="{StaticResource GroupsTemplate}" Grid.Column="0" IsDragDropEnabled="True"/> 
    <TreeView x:Name="TreeView2" Margin="10,20,10,10" ItemsSource="{Binding Groups}" ItemTemplate="{StaticResource GroupsTemplate}" Grid.Column="1" IsDragDropEnabled="True"/> 
    <TreeView x:Name="TreeView3" Margin="10,20,10,10" ItemsSource="{Binding Groups}" ItemTemplate="{StaticResource GroupsTemplate}" Grid.Column="2" IsDragDropEnabled="True"/> 
</Grid>
Tim Rutter
  • 4,549
  • 3
  • 23
  • 47

1 Answers1

0

I strongly recommend for you as a newbie to study/try to code in MVVM design pattern. In MVVM you can use this great answer for your requirements.

Anyway,for your current problem:

Community
  • 1
  • 1
Noam M
  • 3,156
  • 5
  • 26
  • 41