protected override void SetupEditControls() { Category parentCategory = null; var definition = PageDefinition.Load(PropertyData.PageDefinitionID); if (!string.IsNullOrEmpty(definition.HelpText)) { parentCategory = Category.Find(definition.HelpText); } if (parentCategory == null) { parentCategory = Category.Find(Name); } if (parentCategory == null) { parentCategory = Category.GetRoot(); } CategorgyIds = GetCategoryIds(PropertyData.Value.ToString()); foreach (Category category in parentCategory.Categories) { var li = new ListItem(category.Description, category.ID.ToString(CultureInfo.InvariantCulture)); li.Selected = CategorgyIds.Any(c => c == category.ID); EditControl.Items.Add(li); } }
public PageDefinition Load(int id) { return(PageDefinition.Load(id)); }