Parameter.SelectAllValues Property
Gets or sets whether to assign the multi-value parameter‘s all predefined values to the Value property.
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, to assign the multi-value parameter’s all predefined values to the Value property; otherwise, false. |
Remarks
The parameter’s all predefined values are assigned to the Value property when you enable SelectAllValues. If the parameter’s Visible property is enabled, the Parameters panel displays the parameter’s editor with all values selected.
If the Visible property is disabled, all predefined values are submitted to the report.
Note
Predefined values are not unassigned from the Value property if you disable SelectAllValues. Assign an empty array to the Value property to unselect all values.
Example
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;