Back to Devexpress

Add Custom Controls to the Toolbox

xtrareports-402526-feature-guide-to-devexpress-reports-use-report-controls-use-custom-controls-add-custom-controls-to-the-toolbox.md

latest3.7 KB
Original Source

Add Custom Controls to the Toolbox

  • Feb 18, 2026
  • 2 minutes to read

Add to the Visual Studio Toolbox

.NET and .NET Framework

To add a custom control to the Visual Studio Toolbox , set the ToolboxItem attribute to true for the custom control class:

csharp
[ToolboxItem(true)]
public class CustomControl : XRControl {
    //...
}
vb
<ToolboxItem(True)>
Public Class CustomControl
    Inherits XRControl

    '...
End Class

If you implement a custom control in a report project, the control appears in the Toolbox after you specify the ToolboxItem attribute and rebuild the project.

.NET Framework (Custom Control in a Standalone Assembly)

If you store a custom control in a separate assembly, add a toolbox item from that assembly manually. For this, right-click the DX.25.2: Report Controls Toolbox tab, and select Choose items.

In the invoked Choose Toolbox Items dialog, click Browse and specify the path to the assembly. Then select the added assembly:

Specify an Icon for the Visual Studio Toolbox

After you add a custom control to the Toolbox , the control’s icon in the Toolbox and Report Explorer is set to the default icon. If you implement a control in a separate assembly, you can specify a custom bitmap icon for this control. To do this, do the following:

  1. Add an icon to the project where the control class is stored and set the icon’s Build Action property to Embedded Resource.

  2. Apply the ToolboxBitmapAttribute attribute to the control’s class to specify the icon:

  3. Rebuild the project and add the updated control to the toolbox.

Add to the End-User Report Designer Toolbox

Refer to the following tutorials for information on how to add a custom control to an End-User Report Designer’s toolbox on different application platforms: