I have a function in sitefinity that returns a list of categories.
private IList<ICategory> GetCategoryDataSource() {
var cntManager = new ContentManager(CaseStudyManager.DefaultContentProvider);
IList allCategories = cntManager.GetCategories();
List<ICategory> filteredList = new List<ICategory>();
foreach (ICategory category in allCategories) {
filteredList.Add(category);
}
return filteredList;
}
I want to know how to sort this list.
Categories in Sitefinity - as far as I can just specify a string, there are no other fields related to the category. Therefore, I have nothing to sort by category other than adding each category with a number, for example:
1 - Legal
2 - Financial
3 - Property
When these categories are displayed on the website, I can at least trim the parts that I need.
Can anyone help with sorting?
Thanks al
source
share