This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
var configManager = Config.GetManager(); var toolboxConfig = configManager.GetSection<ToolboxesConfig>(); var retrieveSectionNames = toolboxConfig.Toolboxes["PageControls"] .Sections.ToList<ToolboxSection>().Select(s => s.Name);var toolboxItems = toolboxConfig.Toolboxes["PageControls"] .Sections.ToList<ToolboxSection>() .Where(g => g.Name =="NavigationControls") .FirstOrDefault().Tools;var originalConfigs = toolboxItems.Reverse<ToolboxItem>().ToList<ToolboxItem>(); //remove all controls from the section while (toolboxItems.Count > 0) { toolboxItems.RemoveAt(0); } configManager.SaveSection(toolboxConfig); //add the ordered controls back to the section foreach (var item in originalConfigs) { toolboxItems.Add(item); } configManager.SaveSection(toolboxConfig);Subscribe to get all the news, info and tutorials you need to build better business apps and sites