Generating custom control toolbox
Is it possible to generate a custom control toolbox through the fluent API?
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);
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.