Skip to main content
All docs
V23.2

CustomItemData.GetBindings(String) Method

Returns a collection of CustomItemBindingValue objects.

Namespace: DevExpress.DashboardCommon

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

NuGet Package: DevExpress.Dashboard.Core

Declaration

public IList<CustomItemBindingValue> GetBindings(
    string sectionName
)

Parameters

Name Type Description
sectionName String

The name of the Measure or Dimension property that is declared in metadata and corresponds to the data section.

Returns

Type Description
IList<CustomItemBindingValue>

A CustomItemBindingValue collection.

Remarks

The GetBindings method gets a CustomItemBindingValue collection. Each object in this collection contains information about data items stored in custom item metadata. You can use the object’s UniqueId property value as a data member when you bind a custom control to data.

The following example shows how to bind data to a custom chart’s series.

using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
using DevExpress.XtraCharts;
using System.Collections.Generic;
using System.Linq;

namespace CustomItemsSample {
 public class FunnelItemControlProvider : CustomControlProviderBase {
  // ...
  protected override void UpdateControl(CustomItemData customItemData){
      chart.Series.Clear();
      IList<CustomItemBindingValue> valuesSectionBindings = customItemData.GetBindings(nameof(FunnelItemMetadata.Value));
      IList<CustomItemBindingValue> argumentsSectionBindings = customItemData.GetBindings(nameof(FunnelItemMetadata.Arguments));
      if (valuesSectionBindings.Count > 0 && argumentsSectionBindings.Count > 0)
      {
          Series series = new Series("A Funnel Series", ViewType.Funnel);
          flatData = customItemData.GetFlatData(new DashboardFlatDataSourceOptions() { AddColoringColumns = true });
          series.DataSource = flatData;
          series.ValueDataMembers.AddRange(valuesSectionBindings[0].UniqueId);
          series.ArgumentDataMember = argumentsSectionBindings.Last().UniqueId;
          series.ColorDataMember = flatData.GetColoringColumn(valuesSectionBindings[0].UniqueId).Name;
          chart.Series.Add(series);
      }
  }
 }
}
See Also