Generating custom control toolbox

Posted by Community Admin on 03-Aug-2018 10:12

Generating custom control toolbox

All Replies

Posted by Community Admin on 27-Aug-2010 00:00

Is it possible to generate a custom control  toolbox through the fluent API?


Im creating a module and this module has some different custom controls in it. So I was wondering if its possible to register these custom controls in a new toolbox? So the user only have to register the module, and then the module sets up the toolbox.

Posted by Community Admin on 27-Aug-2010 00:00

Hello Daniel,

It is possible. Inyour module override InitializeToolbox and add controls/sections to the toolbox

var toolboxes = Config.Get<ToolboxesConfig>();
var moduleControls = toolboxes.Toolboxes["ModuleControls"];
 
var section = moduleControls
    .Sections
    .Where<ToolboxSection>(r => r.Name == "ModuleToolboxSection")
    .FirstOrDefault();
 
if (section == null)
    section = new ToolboxSection(moduleControls.Sections)
    
        Name = "ModuleToolboxSection",
        Title = "ModuleToolboxSection",
        Description = "ModuleToolboxSection",
       
    ;
    moduleControls.Sections.Add(section);
if (!section.Tools.Any<ToolboxItem>(q => q.Name == "RadCalendar"))
    var tool = new ToolboxItem(section.Tools)
    
        Name = "RadCalendar",
        Title = "RadCalendar",
        Description = "RadCalendar",
        ModuleName = MyModule.ModuleName,
        CssClass = "sss",
        ControlType = typeof(RadCalendar).AssemblyQualifiedName
    ;
    section.Tools.Add(tool);


All the best,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 27-Aug-2010 00:00

Thanks Ivan.

So nice :-)

I really Like this product :-)

/Daniel

Posted by Community Admin on 27-Aug-2010 00:00

Yeah, it's pretty sweet eh :)

I've already sold an upcoming project on it, and converted another dev shop from DNN over to SF4 (and they've already sold a project on it)...the designer is crazy good. 

This thread is closed