CustomFileSummary, get categories

Vote:
 
I've defined own custom values in the FileSummary.config file and now i want to be able to filter on these values (e.g. categories) by binding these values to a dropdown list, the only way i've found is to load the file itself and try to retrieve the values "manually", isn't there an easier way?
#25881
Nov 11, 2008 10:07
Vote:
 

Atm i got like this (which works but is far from perfect):

XDocument document = XDocument.Load(Server.MapPath(root.CustomFileSummaryVirtualPath));
var languages = from d in document.Descendants()
where d.Parent != null && d.Parent.Attribute("ref") != null && d.Parent.Attribute("ref").Value == "Language"
select new { Text = Toolbox.Translate("/pagespecific/t8/filters/languages/" + ((XElement)d.FirstNode).Value.ToLower()),
Value = ((XElement)d.LastNode).Value };

LanguageDropDownList.DataSource = languages;
LanguageDropDownList.DataTextField = "Text";
LanguageDropDownList.DataValueField = "Value";
LanguageDropDownList.DataBind();

 

#25885
Nov 11, 2008 11:37