Parameter.MultiValue Property

Specifies whether or not a parameter can have multiple values.

Namespace: DevExpress.XtraReports.Parameters

Assembly: DevExpress.Printing.v20.2.Core.dll

Declaration

[DefaultValue(false)]
public virtual bool MultiValue { get; set; }
<DefaultValue(False)>
Public Overridable Property MultiValue As Boolean

Property Value

Type Default Description
Boolean

false

true if a parameter can have multiple values; otherwise false.

Remarks

When the MultiValue property is set to true, the Parameter.Value property contains a list of values whose type is specified by the Parameter.Type property.

The code sample below demonstrates how to create a multi-value parameter where predefined values are stored in a data source. The code enables the parameter's SelectAllValues to assign all predefined values to the parameter's Value.

using System;
using System.Windows.Forms;
using DevExpress.XtraReports.Parameters;
// ...

// Create a parameter and specify its name.
Parameter parameter1 = new Parameter();
parameter1.Name = "CategoryIDs";

// Specify other parameter properties.
parameter1.Type = typeof(System.Int32);
parameter1.MultiValue = true;
parameter1.Description = "Categories: ";

DynamicListLookUpSettings lookupSettings = new DynamicListLookUpSettings();
lookupSettings.DataSource = report.DataSource;
lookupSettings.DataMember = "Categories";
lookupSettings.DisplayMember = "CategoryName";
lookupSettings.ValueMember = "CategoryId";

parameter1.LookUpSettings = lookupSettings;
parameter1.Visible = true;
parameter1.SelectAllValues = true;

When previewing the resulting report, an end-user will be prompted to specify values for the parameter using the drop-down multi-select list as shown in the following image.

multi-value-parameters-example

Implements

DevExpress.Data.IMultiValueParameter.MultiValue
See Also