Expression >
Forums Home
>
Related Technologies Forums
>
Windows Presentation Foundation (WPF)
>
WPF TreeView Multiple Sources
WPF TreeView Multiple Sources
- Hello,
I have seem some posts similar to what I'm trying to do (but now the same thing):
I have treeview bound to a list of business objects of type PieceGroup, that represents a group of pieces that must be produced. The items on the treeview are groupd by the Material property (complex type). This is working fine.
Now, I would like to have child nodes of every material type that are not members of the material property, so I will have to build the list of children programatically. I was thiniing about using a converter, but it seems not to be working. Here is what I'm doing today
<pre lang=x-xml><CollectionViewSource x:Key="MaterialProcessingSource"> <CollectionViewSource.GroupDescriptions> <PropertyGroupDescription PropertyName="Material"> </PropertyGroupDescription> </CollectionViewSource.GroupDescriptions> </CollectionViewSource> <DataTemplate x:Key="repositoryTemplate"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=width"/> <TextBlock Text=" X "/> <TextBlock Text="{Binding Path=length}"/> </StackPanel> </DataTemplate> <HierarchicalDataTemplate x:Key="detailDataTemplate" ItemsSource="{Binding Path=Items}" ItemTemplate="{StaticResource repositoryTemplate}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Items[0].Material.code }"/> <TextBlock Text=" - "/> <TextBlock Text="{Binding Items[0].Material.description }"/> </StackPanel> </HierarchicalDataTemplate>
I think that I must somehow change my detailDataTemplate binding to bind to a runtime generated list, based on my business requirements. How can I do that?
Thanks in Advance,
Igor
Project Manager at INOVATIVA Tecnologia www.inovativatec.com- Changed TypeLinda LiuMSFT, ModeratorMonday, November 16, 2009 3:30 AMNo follow up from OP
All Replies
Hi,
Here, my example chk it multiple source functionaly is there.. with dynamacally functionality..
http://www.sendspace.com/file/g0pzws
Thanks
Ram- Proposed As Answer byRammohan Ammiti Monday, November 09, 2009 12:31 PM
- Hi Igor,
> Now, I would like to have child nodes of every material type that are not members of the material property, so I will have to build the list of children programatically.
What do you mean in the above sentence?
Coud you please create a simple project to demonstrate what you want and send it to me. My email address is v-lliu@microsoft.com.
Sincerely,
Linda Liu
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. Hi Igor,
How about the problem now? If you need help, please feel free to let me know.
Sincerely,
Linda Liu
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- We are changing the issue type to “General Discussion” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by opening the Options list at the top of the post window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

