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

Parameter.MultiValue Property

Specifies whether or not a parameter can have multiple values.

Namespace: DevExpress.XtraReports.Parameters

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

NuGet Packages: DevExpress.Printing.Core, DevExpress.WindowsDesktop.Printing.Core

Declaration

[DefaultValue(false)]
public virtual bool MultiValue { get; set; }

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

The following code snippets (auto-collected from DevExpress Examples) contain references to the MultiValue 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