I have a GridView with a ItemsSource of WorkOrder.WorkItems bound in XAML. I then use RowDetails to show the details of the WorkOrderItem. In my rowdetails I am showing a few properties of the item and also want to use a TreeView to display Parts and Labor related to the WorkOrderItem. What I'd like to do is create the TreeView with 2 static nodes. One of the nodes ItemSource would be WorkItem Parts collection and the other wouold have an ItemSource of WorItem Labor. I would them implement a DataTemplateSelector to determine which template to use to display the children of each node. Is this doable?
Example:
WorkOrder
WorkItems as ObservableCollection(of WorkItem)
WorkItem
WorkItemType as String
DueDate as DateTime
Parts as ObservableCollection(of WorkItemPart)
Labor as ObservableCollection(of WorkItemLabor)
<DataTemplate x:Key="DetailsTemplate">
<StackPanel>
<TextBox Text={Binding WorkItemType}/>
<telerikNavigation:RadTreeView>
<telerikNavigation:RadTreeViewItem ItemsSource={Binding Parts} Header="Parts"/>
<telerikNavigation:RadTreeViewItem ItemsSource={Binding Labor} Header="Labor"/>
</telerikNavigation:RadTreeView>
</StackPanel>
</DataTemplate>
<telerikGridView:RadGridView ItemSource={Binding WorkOrder.WorkItems} RowDetailsTemplate="{StaticResource DetailsTemplate}" />
Example:
WorkOrder
WorkItems as ObservableCollection(of WorkItem)
WorkItem
WorkItemType as String
DueDate as DateTime
Parts as ObservableCollection(of WorkItemPart)
Labor as ObservableCollection(of WorkItemLabor)
<DataTemplate x:Key="DetailsTemplate">
<StackPanel>
<TextBox Text={Binding WorkItemType}/>
<telerikNavigation:RadTreeView>
<telerikNavigation:RadTreeViewItem ItemsSource={Binding Parts} Header="Parts"/>
<telerikNavigation:RadTreeViewItem ItemsSource={Binding Labor} Header="Labor"/>
</telerikNavigation:RadTreeView>
</StackPanel>
</DataTemplate>
<telerikGridView:RadGridView ItemSource={Binding WorkOrder.WorkItems} RowDetailsTemplate="{StaticResource DetailsTemplate}" />