IDashboardControl.CustomDashboardItemControlCreating Event
Occurs when a dashboard control visualizes a custom item.
Namespace: DevExpress.DashboardWin
Assembly: DevExpress.Dashboard.v24.1.Win.dll
NuGet Package: DevExpress.Win.Dashboard
Declaration
Event Data
The CustomDashboardItemControlCreating event's data class is CustomDashboardItemControlCreatingEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
CustomControlProvider | Gets or sets a custom control that displays a custom dashboard item. |
DashboardItemName | Gets the component name of the custom dashboard item. |
MetadataType | Gets a custom item’s metadata type. |
Remarks
The CustomDashboardItemControlCreating
event fires each time a dashboard control visualizes a custom item. For example, when you add a custom item to a dashboard’s layout or open a saved dashboard with custom items added to the dashboard’s layout.
The event fires only for custom items whose metadata is registered in the CustomItemMetadataTypes
collection.
Assign a CustomControlProviderBase class descendant to the CustomDashboardItemControlCreatingEventArgs.CustomControlProvider property. The CustomControlProviderBase
object displays a custom item.
The following code snippet shows how to display a custom Funnel item:
using System.Collections.Generic;
using System.Windows.Forms;
using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
namespace CustomItemsSample {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
//...
}
private void DashboardControl1_CustomDashboardItemControlCreating(object sender, CustomDashboardItemControlCreatingEventArgs e){
if(e.MetadataType == typeof(CustomFunnelMetadata))
e.CustomControlProvider = new CustomFunnelControlProvider(dashboardControl1, dashboardControl1.Dashboard.Items[e.DashboardItemName] as CustomDashboardItem<CustomFunnelMetadata>);
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomDashboardItemControlCreating event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.