I am looking for an example that loads a treeview from data that is not self-referencing (no ParentID field) but with specific category levels. If my data looks like:
ID Lastname Firstname City State
1 Davolio Nancy Seattle WA
2 Fuller Andrew Tacoma WA
3 Washington George Dallas TX
4 Leverling Janet Kirkland WA
5 Peacock Margaret Seattle WA
6 Doe Jane Austin TX
7 Doe John Dallas TX
… I want it to come out like this:
TX
└ Austin
└ Jane Doe
└ Dallas
└ George Washington
└ John Doe
WA
└ Kirkland
└ Janet Leverling
└ Seattle
└ Nancy Davolio
└ Margaret Peacock
└ Tacoma
└ Andrew Fuller
I also would like it to load on demand (JsonResult) as each state and city gets expanded.
Is there an example on how to build the tree like this?
ID Lastname Firstname City State
1 Davolio Nancy Seattle WA
2 Fuller Andrew Tacoma WA
3 Washington George Dallas TX
4 Leverling Janet Kirkland WA
5 Peacock Margaret Seattle WA
6 Doe Jane Austin TX
7 Doe John Dallas TX
… I want it to come out like this:
TX
└ Austin
└ Jane Doe
└ Dallas
└ George Washington
└ John Doe
WA
└ Kirkland
└ Janet Leverling
└ Seattle
└ Nancy Davolio
└ Margaret Peacock
└ Tacoma
└ Andrew Fuller
I also would like it to load on demand (JsonResult) as each state and city gets expanded.
Is there an example on how to build the tree like this?