Back to Devexpress

DynamicListLookUpSettings Class

dashboard-devexpress-dot-dashboardcommon-4b251947.md

latest6.2 KB
Original Source

DynamicListLookUpSettings Class

Provides the look-up editor settings for dashboard parameters that are bound to a data source.

Namespace : DevExpress.DashboardCommon

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

NuGet Package : DevExpress.Dashboard.Core

Declaration

csharp
public class DynamicListLookUpSettings :
    ParameterLookUpSettings
vb
Public Class DynamicListLookUpSettings
    Inherits ParameterLookUpSettings

Remarks

Use the DashboardParameter.LookUpSettings property to specify the look-up editor settings of the parameter.

Example

The following example demonstrates how to create a new dashboard parameter and pass it to a dashboard item filter string.

In this example, the dashboard data source contains two queries:

  • The SalesPerson query is used for data visualization
  • The Categories query supplies values for the dashboard parameter

The dashboard items display data according to the selected values of the dashboard parameter.

View Example

csharp
using DevExpress.XtraEditors;
using DevExpress.DashboardCommon;

namespace Dashboard_Parameters {
    public partial class Form1 : XtraForm {
        public Form1() {
            InitializeComponent();
            Dashboard dashboard = new Dashboard();
            dashboard.LoadFromXml(@"..\..\Data\Dashboard.xml");

            // Obtain dashboard items and specify identifiers for data items.
            GridDashboardItem grid = (GridDashboardItem)dashboard.Items[0];
            PieDashboardItem pie = (PieDashboardItem)dashboard.Items[1];  
            ((GridDimensionColumn)grid.Columns[0]).Dimension.UniqueId = "categoryColumn";
            pie.SeriesDimensions[0].UniqueId = "categorySeries";

            // Obtain the dashboard data source used to provide parameter values.
            DashboardSqlDataSource parameterDataSource = 
                (DashboardSqlDataSource)dashboard.DataSources[0];

            // Create a new parameter that obtains its values from the Categories query.
            DynamicListLookUpSettings settings = new DynamicListLookUpSettings();
            settings.DataSource = parameterDataSource;
            settings.DataMember = "Categories";
            settings.ValueMember = "CategoryName";
            DashboardParameter parameter = new DashboardParameter("categoryParameter", 
                typeof(string), "Beverages", "Select categories:", true, settings);
            // Enable multi-selection for the created parameter.
            parameter.AllowMultiselect = true;

            // Add the created parameter to a collection of dashboard parameters.
            dashboard.Parameters.Add(parameter);

            // Include the created parameter in filter strings as an operand value.
            grid.FilterString = "categoryColumn in (?categoryParameter)";
            pie.FilterString = "categorySeries in (?categoryParameter)";

            dashboardViewer1.Dashboard = dashboard;
        }
    }
}
vb
Imports DevExpress.XtraEditors
Imports DevExpress.DashboardCommon

Namespace Dashboard_Parameters
    Partial Public Class Form1
        Inherits XtraForm

        Public Sub New()
            InitializeComponent()
            Dim dashboard As New Dashboard()
            dashboard.LoadFromXml("..\..\Data\Dashboard.xml")

            ' Obtain dashboard items and specify identifiers for data items.
            Dim grid As GridDashboardItem = CType(dashboard.Items(0), GridDashboardItem)
            Dim pie As PieDashboardItem = CType(dashboard.Items(1), PieDashboardItem)
            CType(grid.Columns(0), GridDimensionColumn).Dimension.UniqueId = "categoryColumn"
            pie.SeriesDimensions(0).UniqueId = "categorySeries"

            ' Obtain the dashboard data source used to provide parameter values.
            Dim parameterDataSource As DashboardSqlDataSource = DirectCast(dashboard.DataSources(0), DashboardSqlDataSource)

            ' Create a new parameter that obtains its values from the Categories query.
            Dim settings As New DynamicListLookUpSettings()
            settings.DataSource = parameterDataSource
            settings.DataMember = "Categories"
            settings.ValueMember = "CategoryName"
            Dim parameter As New DashboardParameter("categoryParameter", GetType(String), "Beverages", "Select categories:", True, settings)
            ' Enable multi-selection for the created parameter.
            parameter.AllowMultiselect = True

            ' Add the created parameter to a collection of dashboard parameters.
            dashboard.Parameters.Add(parameter)

            ' Include the created parameter in filter strings as an operand value.
            grid.FilterString = "categoryColumn in (?categoryParameter)"
            pie.FilterString = "categorySeries in (?categoryParameter)"

            dashboardViewer1.Dashboard = dashboard
        End Sub
    End Class
End Namespace

Inheritance

Object ParameterLookUpSettings DynamicListLookUpSettings

See Also

DynamicListLookUpSettings Members

LookUpSettings

DevExpress.DashboardCommon Namespace