Skip to main content
A newer version of this page is available. .

BoundImageDashboardItem.DataBindingMode Property

Gets or sets the data binding mode used to bind the BoundImageDashboardItem to data.

Namespace: DevExpress.DashboardCommon

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

NuGet Package: DevExpress.Dashboard.Core

Declaration

[DefaultValue(ImageDataBindingMode.BinaryArray)]
public ImageDataBindingMode DataBindingMode { get; set; }

Property Value

Type Default Description
ImageDataBindingMode **BinaryArray**

An ImageDataBindingMode enumeration member that specifies the data binding mode used to bind the BoundImageDashboardItem to data.

Example

The following example shows how to use a Bound Image dashboard item to display a specified image accessible by a predefined URI.

View Example

using System.Windows.Forms;
using DevExpress.DashboardCommon;
using DevExpress.DataAccess.ConnectionParameters;
using DevExpress.DataAccess.Sql;
using DevExpress.XtraEditors;

namespace Dashboard_BoundImage {
    public partial class Form1 : XtraForm {
        public Form1() {
            InitializeComponent();
            Dashboard dashboard = new Dashboard();

            XmlFileConnectionParameters xmlParams = new XmlFileConnectionParameters();
            xmlParams.FileName = @"..\..\Data\DashboardProductDetails.xml";

            DashboardSqlDataSource xmlDataSource = new DashboardSqlDataSource("Data Source 1", xmlParams);
            SelectQuery selectQuery = SelectQueryFluentBuilder
                .AddTable("Products")
                .SelectColumns("Id", "Name", "Description")
                .Build("Query 1");
            xmlDataSource.Queries.Add(selectQuery);
            xmlDataSource.Fill();
            dashboard.DataSources.Add(xmlDataSource);

            BoundImageDashboardItem boundImage = new BoundImageDashboardItem();
            boundImage.DataSource = xmlDataSource; boundImage.DataMember = "Query 1";
            boundImage.DataBindingMode = ImageDataBindingMode.Uri;
            boundImage.ImageDimension = new Dimension("Name");
            boundImage.UriPattern = @"..\..\ProductDetailsImages\{0}.jpg";
            boundImage.SizeMode = ImageSizeMode.Stretch;

            ListBoxDashboardItem comboBox = new ListBoxDashboardItem();
            comboBox.ShowCaption = false;
            comboBox.DataSource = xmlDataSource; comboBox.DataMember = "Query 1";
            comboBox.FilterDimensions.Add(new Dimension("Name"));
            comboBox.ListBoxType = ListBoxDashboardItemType.Radio;
            comboBox.ShowAllValue = false;

            dashboard.Items.AddRange(comboBox, boundImage);
            dashboardViewer1.Dashboard = dashboard;
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DataBindingMode property.

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.

See Also