DashboardFlatDataSourceOptions.AddDisplayTextColumns Property
Specifies whether the CustomItemData.GetFlatData(DashboardFlatDataSourceOptions) method should add display text columns to DashboardFlatDataSource.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v24.1.Core.dll
NuGet Package: DevExpress.Dashboard.Core
Declaration
Property Value
Type | Description |
---|---|
Boolean | true to add display text columns; otherwise, false. |
Remarks
You can include display text values for each data column in a flat data source. To accomplish this, set the AddDisplayTextColumns
property to true and pass the DashboardFlatDataSourceOptions
object to the CustomItemData.GetFlatData(DashboardFlatDataSourceOptions) method.
The following code snippet adds display text columns to the DashboardFlatDataSource
object:
using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
namespace CustomItemsSample {
public class SankeyItemControlProvider : CustomControlProviderBase {
DashboardFlatDataSource flatData;
CustomDashboardItem<SankeyItemMetadata> dashboardItem;
protected override void UpdateControl(CustomItemData customItemData) {
flatData = customItemData.GetFlatData(new DashboardFlatDataSourceOptions() { AddColoringColumns = true, AddDisplayTextColumns = true });
SetDataBindings(flatData);
}
void SetDataBindings(DashboardFlatDataSource flatData) {
sankey.Colorizer = new SankeyItemColorizer(flatData);
sankey.SourceDataMember = flatData.GetDisplayTextColumn(dashboardItem.Metadata.Source.UniqueId).Name;
sankey.TargetDataMember = flatData.GetDisplayTextColumn(dashboardItem.Metadata.Target.UniqueId).Name;
if(dashboardItem.Metadata.Weight != null)
sankey.WeightDataMember = dashboardItem.Metadata.Weight.UniqueId;
try {
sankey.DataSource = flatData;
} catch {
sankey.DataSource = null;
}
}
}
}
See Also