Hi Please help me to realize the fallowing datatemplate in code behind
<TreeView Name="OrderTree" DataContext="{Binding ordersTree}" ItemsSource="{Binding}">
<TreeView.Resources>
<HierarchicalDataTemplate
...
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type ordVM:OrderedDataCollectionVM}">
<ListView Name="orderedListView" Margin="0,5,0,0" ItemsSource="{Binding GridData}">
<ListView.View>
<GridView>
<GridViewColumn DisplayMemberBinding="{Binding Number}" Width="20" />
<GridViewColumn Header="{x:Static lang:ViewTextResource.product_name}" DisplayMemberBinding="{Binding Product.Name}" Width="150" />
<GridViewColumn Header="{Binding GridHeaders.[0]}" CellTemplate="{StaticResource GridViewComboBox1}" Width="120"/>
<GridViewColumn Header="{Binding GridHeaders.[1]}" CellTemplate="{StaticResource GridViewComboBox2}" Width="120"/>
</GridView>
</ListView.View>
</ListView>
</DataTemplate>
</TreeView.Resources>
</TreeView>
I want to create a DataTemplate in code behind for my TreeView with a ListView which has a GridView which columns count depends on my data.