Populate Dropdown with values from categories (taxonomy)
I'm a newbie. i got a three level drop down and i want to populate it with the values. currently the images/videos are categorized from type of "businesstype" as parent ,"country" as child of businesstype, then "state" the last child.
please see my sample code:
TaxonomyManager manager = TaxonomyManager.GetManager();
var taxonomy = manager.GetTaxonomies<HierarchicalTaxonomy>().Where(t => t.Name == "Categories").SingleOrDefault();
var details = taxonomy.Taxa.ToList();
foreach (HierarchicalTaxon taxon in details)
var li = new ListItem(taxon.Title, taxon.Title);
i can get the whole list but i have no way to segregate them by parent to child. i hope youcould give a snipper on how to do it. thanks.
HierarchicalTaxon has a property parent that you can use.
All the best,
the Telerik team