Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3305
How do I define Templates that go down 3 levels or more?
posted

I have an object that is defined as so.

flag

->FlagCriteria

-->flagcriteriaDetals

----FlagCriteriaDetailValues

I need to define templates to show these 3 levels in a xam tree but I can only get 2 to show

her is the xaml i am using (which works great at the 2 curretn levels but I need that third level to display.

I have set the items source of the Tree to the FlagCriteria i code behind.

what am I missing? everytime I attemtp to add another templete I get errors????

 <ig:XamTree Margin="0" Grid.Row="1" Name="detTree" Background="WhiteSmoke" BorderBrush="Transparent">           
            <ig:XamTree.HierarchicalItemTemplate>                
                <ig:HierarchicalDataTemplate ItemsSource="{Binding FlagCriteriaDetail}">                   
                    <DataTemplate>
                        <StackPanel Orientation="Vertical">
                            <TextBlock Text="Rule Details"/>
                            <StackPanel Orientation="Horizontal">
                            <TextBlock Margin="5,0,0,0" Text="Criteria Name:"/>
                            <TextBlock Margin="5,0,0,0" Text="{Binding Path=CriteriaName}"/>
                            <TextBlock Margin="5,0,0,0" Text=" | Search Category:"/>
                            <TextBlock Margin="5,0,0,0" Text="{Binding Path=SearchCategory}"/>
                            <TextBlock Margin="5,0,0,0" Text=" | Search Type:"/>
                            <TextBlock Margin="5,0,0,0" Text="{Binding Path=SearchType}"/>
                        </StackPanel> 
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Margin="15,0,0,0" Text="Where Clause:"/>
                                <TextBlock Margin="5,0,0,0" Text="{Binding Path=WhereClause}"/>
                            </StackPanel>
                        </StackPanel>                      
                    </DataTemplate>                     
                    <ig:HierarchicalDataTemplate.ItemTemplate >
                        <DataTemplate>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Text="Detail Information"/>
                                <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Table/Field:"/>
                                <TextBlock   Margin="3,0,0,0"  Text="{Binding TableAlias}"/>	
                                <TextBlock Text=" | Operator:"/>
                                <TextBlock Margin="5,0,0,0" Text="{Binding SearchOperator}"/>
                                <TextBlock Text=" | search Value:"/>
                                <TextBlock Margin="5,0,0,0" Text="{Binding SearchValue}"/>                                
                            </StackPanel> 
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Margin="15,0,0,0" Text="Population Set:"/>
                                    <TextBlock Margin="5,0,0,0" Text="{Binding Path=PopulationSet}"/>
                                    <TextBlock Margin="15,0,0,0" Text="Reference Set:"/>
                                    <TextBlock Margin="5,0,0,0" Text="{Binding Path=QualificationName}"/>
                                </StackPanel>
                            </StackPanel>                           
                        </DataTemplate>      
                    </ig:HierarchicalDataTemplate.ItemTemplate>
                </ig:HierarchicalDataTemplate>           
            </ig:XamTree.HierarchicalItemTemplate>           
        </ig:XamTree>

 

Parents
  • 5595
    Suggested Answer
    posted

    Hello,

    You need to define several levels of nesting item templates as follows:

            <igTree:XamWebTree x:Name="TestXamWebTree" ItemsSource="{Binding}">
                <!--THE ROOT LEVEL ITEM TEMPLATE IS HIERARCHICAL-->
                <igTree:XamWebTree.HierarchicalItemTemplate>
                    <ig:HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
                        <!--THE DATA TEMPLATE FOR THE ROOT LEVEL ITEM FOLLOWS-->
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}"/>
                        </DataTemplate>
                        <!--THE FIRST LEVEL CHILD ITEM TEMPLATE IS HIERARCHICAL-->
                        <ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                            <ig:HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
                                <!--THE DATA TEMPLATE FOR THE FIRST LEVEL CHILD ITEM FOLLOWS-->
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name}"/>
                                </DataTemplate>
                                <!--THE SECOND LEVEL CHILD ITEM TEMPLATE IS NON-HIERARCHICAL-->
                                <ig:HierarchicalDataTemplate.ItemTemplate>
                                    <!--THE DATA TEMPLATE FOR THE SECOND LEVEL CHILD ITEM FOLLOWS-->
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Name}"/>
                                    </DataTemplate>
                                </ig:HierarchicalDataTemplate.ItemTemplate>
                            </ig:HierarchicalDataTemplate>
                        </ig:HierarchicalDataTemplate.HierarchicalItemTemplate>
                    </ig:HierarchicalDataTemplate>
                </igTree:XamWebTree.HierarchicalItemTemplate>
            </igTree:XamWebTree>
    

     

    HTH

     

Reply Children
No Data