Skip to main content
All docs
V24.1

CustomDashboardItem<T>.Metadata Property

Gets custom item metadata.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v24.1.Core.dll

NuGet Package: DevExpress.Dashboard.Core

Declaration

public T Metadata { get; }

Property Value

Type Description
T

A CustomItemMetadata class descendant.

Remarks

Metadata defines the data item structure in a custom dashboard item. The Metadata property gets custom item metadata and allows you to change it. You can get the existing data items from metadata properties and add new data items. The DataItem.UniqueId property allows you to get data items from metadata.

The following code snippet shows how to get data items from CustomFunnelMetadata and use them to bind flat data to a Funnel chart series:

using System.Windows.Forms;
using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
using DevExpress.XtraCharts;

public class CustomFunnelControlProvider : CustomControlProviderBase {
  CustomDashboardItem<CustomFunnelMetadata> dashboardItem;
  //...
  protected override void UpdateControl(CustomItemData customItemData){
      chart.Series.Clear();
      if(dashboardItem.Metadata.Value != null && dashboardItem.Metadata.Arguments.Count > 0) {
          Series series = new Series("A Funnel Series", ViewType.Funnel);
          flatData = customItemData.GetFlatData(new DashboardFlatDataSourceOptions() {
             AddColoringColumns = true });
          series.DataSource = flatData;
          series.ValueDataMembers.AddRange(dashboardItem.Metadata.Value.UniqueId);
          series.ArgumentDataMember = dashboardItem.Metadata.Arguments.Last().UniqueId;
          series.ColorDataMember = flatData.GetColoringColumn(dashboardItem.Metadata.Value.UniqueId).Name;
          chart.Series.Add(series);
      }
  }
}
See Also