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

  • Home
  • SEARCH
  • 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 854417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:55:14+00:00 2026-05-15T07:55:14+00:00

I’m trying to figure out the best practice to setup hierarchy data that i

  • 0

I’m trying to figure out the best practice to setup hierarchy data that i take from a database into some contoller that would show the hierachy.
Basicly this would look like a normal tree but when you press the items that are under “chapters” you get a link to another page.

I have these tables and this is the way they are connected

Period
Courses
Subjects
Chapters

I select Period from a DropDownBox and then i want all the courses in that period to line up.
Under each course would be the subject and under them are the chapers, typical hierarchy.

The tables are linked together with refrences to each other in linear way.

I have tried to use treeview to show this, but dont understand how to do it.
I though i could use <ul><il> tags and do it at runtime.
Reapeter or datalist, possible ?

Is it better to do this with databinding in XAML or in code ?

  • 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-05-15T07:55:15+00:00Added an answer on May 15, 2026 at 7:55 am

    In my experience its best to to it with li and ul. You have more control of how everything is displayed. I got the query that gives me all the records and parent and depth. Then I loop throught this data and generated the list tags.

    foreach (DataRow row in navigationTable.Rows)
    {

                var currentDepth = int.Parse(row["depth"].ToString());
    
                if (lastDepth < currentDepth)
                {
                    output.Append("<ul>");
                    numUl++;
                }
                else if (lastDepth > currentDepth)
                {
                    while (lastDepth > currentDepth)
                    {
                        output.Append("</li></ul></li>");
                        numUl--;
                        lastDepth--;
                    }
                }
                else if (lastDepth > -1)
                {
                    output.Append("</li>");
                }
    
                output.AppendFormat("<li id=\"base\" class=\"class\">{3}<a>link</a>
    
                lastDepth = currentDepth;
            }
    
            for (var i = 1; i <= numUl; i++)
            {
                output.Append("</li></ul>");
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post
I have a view passing on information from a database: def serve_article(request, id): served_article
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

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.