Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8461255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:49:47+00:00 2026-06-10T13:49:47+00:00

I have three linked Entities (Categories->Types->Classes) with one to many relationship. Is it possible

  • 0

I have three linked Entities (Categories->Types->Classes) with one to many relationship.
Is it possible to bind only Categories entity and represent the rest using Navigation properties andHierarchicalDataTemplate ?

I imagine something like this :

<TreeView ItemsSource="{Binding Categories}">

            <TreeView.ItemTemplate>

                <HierarchicalDataTemplate ItemsSource="{Binding Categories}" >
                    <TextBlock Foreground="Red" Text="{Binding Types}" />

                    <HierarchicalDataTemplate.ItemTemplate>
                        <HierarchicalDataTemplate ItemsSource="{Binding Classes}">
                            <TextBlock Text="{Binding TypeName}" />

                            <HierarchicalDataTemplate.ItemTemplate>
                                <DataTemplate >
                                    <TextBlock Text="{Binding ClassName}" />
                                </DataTemplate>
                            </HierarchicalDataTemplate.ItemTemplate>

                        </HierarchicalDataTemplate>

                    </HierarchicalDataTemplate.ItemTemplate>

                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>

        </TreeView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:49:48+00:00Added an answer on June 10, 2026 at 1:49 pm

    I’ve done this recently, in a WPF project, I’ve updated the Types to match your names and Nav Properties.

    You might want to consider changing Type/Class to something more specific since they’re used as keywords in the c# language, but I think you get the idea

      <!-- The Root Category Table -->
               <HierarchicalDataTemplateDataType="{x:Type Entities1:Categories}" ItemsSource="{Binding Types}" >
                  <StackPanel Orientation="Horizontal">
                     <Image Name="img" Source="{Binding ., Converter={Converters:DataTypeImageConverter}}" />
                     <TextBlock Text="{Binding CategoryName}" FontWeight="Bold" />
                  </StackPanel>
               </HierarchicalDataTemplate>
               <!-- Your Type Table -->
               <HierarchicalDataTemplate DataType="{x:Type Entities1:Type}"  ItemsSource="{Binding Classes}" >
                  <StackPanel Orientation="Horizontal">
                     <Image Name="img" Source="{Binding ., Converter={Converters:DataTypeImageConverter}}" />
                     <TextBlock  Text="{Binding TypeName}" />
                  </StackPanel>
               </HierarchicalDataTemplate>
               <!-- Your Class Table-->
               <DataTemplate DataType="{x:Type Entities1:Class}">
                  <StackPanel Orientation="Horizontal">
                     <Image Name="img" Source="{Binding ., Converter={Converters:DataTypeImageConverter}}" />
                     <TextBlock Text="{Binding ClassName}" />
                  </StackPanel>
               </DataTemplate>
    

    What this will do is, it will match the datatype in the tree – If it matches Category, it will create the stackpanel, then start another branch, using the navigation collection Types.

    For types, it will do the same basic thing – create the panel for that item, then another branch, for it’s navigation collection Class.

    If it’s class, it will only create the panel, since it’s a DataTemplate, not a HierarchicalDataTemplate

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have three classes User, Group and Field. Many to many relationship on User /
I have two custom entites, Product and ProductType, linked together in many-to-one relationship. Product
I have two entities, Class and Student , linked in a many-to-many relationship. When
Currently I have one managedContext, many NSArrayControllers of entities which are all pretty interrelated,
I have two tables/entities Users and Companies . Both are linked m-n relationship. When
I have three models linked by foreign keys: class One(models.Model): ... class Two(models.Model): one
I have three Custom Post Types in Wordpress: artists, writers, stories Is it possible
I have three database tables: users emails invitations Emails are linked to users by
I have a MySQL query that: gets data from three tables linked by unique
I have three models linked in this manner: Item->Order->Payment Order hasMany Item Order hasOne

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.