How do I display non-normalized data in a hierarchical structure?

Posted by rofly on Stack Overflow See other posts from Stack Overflow or by rofly
Published on 2010-05-06T18:04:29Z Indexed on 2010/05/06 18:08 UTC
Read the original article Hit count: 243

My issue is that I want to display data in a hierarchal structure as so:

  • Democrat
    • County Clerk
      • Candidate 1
      • Candidate 2
    • Magistrate
      • Candidate 1
      • Candidate 2
      • Candidate 3

But I'm retrieving the dataset like this:

Party | Office | Candidate
Democrat | County Clerk | Candidate 1
Democrat | County Clerk | Candidate 2
Democrat | Magistrate | Candidate 1
Democrat | Magistrate | Candidate 2
Democrat | Magistrate | Candidate 3

I planned on using nested repeaters, but I need a distinct value of Party, and then distinct values of office name within that party in order to do it.

Are there any .NET functions to easily do what I'm attempting to? Would there be a better way of displaying the information other than repeaters?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about c#

Related posts about normalization