CustomItemData.GetBindings(String) Method
Returns a collection of CustomItemBindingValue objects.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v25.2.Core.dll
NuGet Package: DevExpress.Dashboard.Core
Declaration
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 |
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);
}
}
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetBindings(String) method.
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.