Message 1 of 2
Getting all document categories even subcategories
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello, i am trying to build windows form includes all available categories in the document, but the problem is I can't get the subcategories, I tried https://thebuildingcoder.typepad.com/blog/2010/05/categories.html , but it doesn't work, can you please tell me whats wrong in my code. Many thanks.
private void LoadCategories()
{
TreeViewCategories.Nodes.Clear();
foreach (Category cat in m_doc.Settings.Categories)
{
if (cat.AllowsBoundParameters == true)
{
if (!(string.IsNullOrEmpty(TxbFilterCat.Text)))
{
if (!cat.Name.ToLower().Contains(TxbFilterCat.Text.ToLower()))
{
continue;
}
}
TreeNode tn = TreeViewCategories.Nodes.Add(cat.Name, cat.Name);
tn.Tag = cat;
}
}
TreeViewCategories.Sort();
}