# GrapeCity.ActiveReports.Design.Designer.Toolbox

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Design_Designer_Toolbox_" data-uid="GrapeCity.ActiveReports.Design.Designer.Toolbox*">Toolbox Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Design_Designer_Toolbox_" data-uid="GrapeCity.ActiveReports.Design.Designer.Toolbox*"></a>
<h4 id="GrapeCity_ActiveReports_Design_Designer_Toolbox" data-uid="GrapeCity.ActiveReports.Design.Designer.Toolbox">Toolbox</h4>
<div class="markdown level1 summary"><p>Gets or sets a value representing the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.design.itoolboxservice">IToolboxService</a> implementation for the report designer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Browsable(false)]
public IToolboxService Toolbox { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.design.itoolboxservice">IToolboxService</a></td>
      <td><p>An instance of <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.design.itoolboxservice">IToolboxService</a> that provides access to the toolbox service used by the report designer.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Design_Designer_Toolbox_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The toolbox service is a key component in the report designer that manages the toolbox items, such as controls and components, which can be dragged onto
the report design surface. This property allows for the customization or replacement of the toolbox service, enabling advanced scenarios such as dynamically
changing the available toolbox items based on certain conditions.</p>
<p>
Note: Setting this property with a custom implementation of <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.design.itoolboxservice">IToolboxService</a> can significantly alter the behavior and capabilities of the report 
designer's toolbox. It should be done with understanding of the underlying mechanics and implications.
</p>
</div>
<h5 id="GrapeCity_ActiveReports_Design_Designer_Toolbox_examples">Examples</h5>
<p>This example illustrates how to add a Designer component and a Toolbox to a Windows Forms application, configuring the Toolbox as the Designer's toolbox.</p>
<pre><code class="lang-csharp">class MyForm : Form
{
	MyForm()
	{
		var designer = new Designer() { Dock = DockStyle.Fill };
		var toolbox = new Toolbox { Dock = DockStyle.Right };
		designer.Toolbox = toolbox;
		Controls.Add(designer);
		Controls.Add(toolbox);
	}
}</code></pre>
<p>Demonstrates how to control the availability of toolbox items in the designer's toolbox.</p>
<pre><code class="lang-csharp">// First, define a state provider by implementing the IToolboxUser interface. This example enables only the BandedListDesigner tool.
class ToolboxStateProvider : IToolboxUser
{
	public bool GetToolSupported(ToolboxItem tool)
	{
		if (tool.TypeName == "GrapeCity.ActiveReports.Design.DdrDesigner.Designers.BandedList.BandedListDesigner")
			return true;
		return false;
	}
	public void ToolPicked(ToolboxItem tool) { }
}</code></pre>
<p>Then, configure the toolbox with the state provider to control the enabled items.</p>
<pre><code class="lang-csharp">toolbox.ConfigureToolboxItems(new ToolboxStateProvider());</code></pre>
<p>This example shows how to remove a specific item from the toolbox. It demonstrates finding the item by its type name and then removing it.</p>
<pre><code class="lang-csharp">private static void RemoveBandedListFromToolBox(Toolbox toolbox)
{
	// Find the item to be removed by its type name.
	var bandedList = toolbox.GetToolboxItems()
		.OfType&lt;ToolboxItem&gt;()
		.Single(items =&gt; items.TypeName.EndsWith("BandedListDesigner"));
	// Remove the found banded list item from the toolbox.
	toolbox.RemoveToolboxItem(items);
}</code></pre>

</div>
