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
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.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-assign-multiple-values-to-a-report-parameter-from-a-connected-data-source-t236094
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.
Related GitHub Examples
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.