ok thanks... it feels like I'm aiming a bazooka at a mousehole though
-------------------------------EDIT
I decided to use my own version. Not quite as robust, but perfect for my scenario. Just in case anyone happens across this post.. I have a parent category for news and then categories for each year. This displays each category from newest to oldest. You can swap sort order or change the listitem with a drop down in the property designer. I'm excluding root level categories, because all of the relevant categories in my News provider are sub categories of a company_news category.. it would probably be easier for some to do an IncludeParentID property, or just add a parent category selector style control.
public partial class NewsCategoriesList : System.Web.UI.WebControls.CompositeControl
{
public enum Sort
{
DESCENDING = 0,
ASCENDING = 1
}
public string ExcludeParentID {get; set;}
public Sort SortOrder { get; set; }
public string ListItemFormatString { get; set; }
public NewsCategoriesList()
{
SortOrder = Sort.DESCENDING;
ListItemFormatString = li;
ExcludeParentID = Guid.Empty.ToString();
}
private string[] sorts = new string[] { "DESC", "ASC" };
private const string li = "<li><a href='/newsroom.aspx?Year={0}'>{0}</a></li>";
protected override void CreateChildControls()
{
//Retrieve list of Categories for "News" Provider
Telerik.News.NewsManager mgr = new Telerik.News.NewsManager("News");
IList categories = mgr.Content.GetCategories(0, 0, "CategoryName " + sorts[(int)SortOrder]);
StringBuilder sb = new StringBuilder("<ul id='NewsCategories'>");
for (int i = 0; (i <= categories.Count - 1); i++)
{
ICategory cat = (ICategory)categories[i];
if (cat.ParentCategoryID.ToString() != ExcludeParentID.ToString())
{
sb.AppendLine(String.Format(ListItemFormatString, cat.CategoryName, cat.ID));
}
}
sb.AppendLine("</ul>");
this.Controls.Add(new LiteralControl(sb.ToString()));
}
}