1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Generating custom control toolbox

Generating custom control toolbox

4 posts, 1 answered
  1. Daniel
    Daniel avatar
    6 posts
    Registered:
    17 Aug 2010
    27 Aug 2010
    Link to this post
    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.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    27 Aug 2010
    Link to this post
    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
    Answered
  3. Daniel
    Daniel avatar
    6 posts
    Registered:
    17 Aug 2010
    27 Aug 2010
    Link to this post
    Thanks Ivan.

    So nice :-)

    I really Like this product :-)

    /Daniel
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    27 Aug 2010
    Link to this post
    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. 
4 posts, 1 answered