Skip to main content
All docs
V23.2

CustomControlProviderBase.UpdateControl(CustomItemData) Method

Updates a custom item based on metadata.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v23.2.Win.dll

NuGet Package: DevExpress.Win.Dashboard

Declaration

protected virtual void UpdateControl(
    CustomItemData customItemData
)

Parameters

Name Type Description
customItemData CustomItemData

A CustomItemData object that contains methods.

Remarks

The UpdateControl method is called each time a custom item’s data or settings change. The method supplies data for a custom item based on measures and dimensions specified in metadata.

You can use one of the following ways to bind a control to data:

MultiDimensionalData
Use MultiDimensionalData if a custom control does not support data sources that implement IList. You can create a data source based on MultiDimensionalData for the control. Call the CustomItemData.GetMultiDimensionalData() method to get MultiDimensionalData.
DashboardFlatDataSource
Use DashboardFlatDataSource if a custom control supports a data source that implements IList. Call the CustomItemData.GetFlatData(DashboardFlatDataSourceOptions) method to get custom item data and bind it to a control.

The following code snippet binds data to a custom control:

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