---
schema_version: "1"
id: f23312d98cb11a59dfe9d8f03002a2689e229b624cef7a955444a3a223eb8cdf
title: DynamicPickListRows Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_VisualEditor_DynamicPickListRows.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 18d5b6a33c0cc7a70138fe85adbf4d10bbe0ba557f5178c10b0c7afad572524d
description: Contains a list of picklist items in a Lightning component on a Lightning page.Creates an instance of the VisualEditor.DynamicPickListRows class using the specified parameters.Creates an instance of the VisualEditor.DynamicPickListRows class using the specified parameter.Creates an instance of the VisualEditor.DynamicPickListRows class. You can then add rows by using the class’s addRow or addAllRows methods.Adds a list of picklist items to a dynamic picklist rendered in a Lightning component on a Lightning page.Adds a single picklist item to a dynamic picklist rendered in a Lightning component on a Lightning page.Makes a duplicate copy of the VisualEditor.DynamicPickListRows object.Returns a Boolean value indicating whether all values of the picklist are included when a user does a type-ahead search query (true) or only those values initially displayed when the list is clicked on (false).Returns a picklist element stored at the specified index.Returns a list of picklist items.Sets the value indicating whether all values of the picklist are included when a user does a type-ahead search query (true) or only those values initially displayed when the list is clicked on (false).Returns the size of the list of VisualEditor.DynamicPickListRows.Sorts the list of VisualEditor.DynamicPickListRows.
---
# DynamicPickListRows Class

Contains a list of picklist items in a Lightning component on a Lightning page.

## Namespace

[VisualEditor](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_VisualEditor.htm#apex_namespace_VisualEditor "The VisualEditor namespace provides classes and methods for interacting with the Lightning App Builder. The classes and methods in this namespace operate on Lightning components, which include Lightning web components and Aura components.")

- **[DynamicPickListRows Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_constructors)**
- **[DynamicPickListRows Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_methods)**

## DynamicPickListRows Constructors

The following are constructors for DynamicPickListRows.

- **[DynamicPickListRows(rows, containsAllRows)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_ctor)**  
    Creates an instance of the VisualEditor.DynamicPickListRows class using the specified parameters.
- **[DynamicPickListRows(rows)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_ctor_2)**  
    Creates an instance of the VisualEditor.DynamicPickListRows class using the specified parameter.
- **[DynamicPickListRows()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_ctor_3)**  
    Creates an instance of the VisualEditor.DynamicPickListRows class. You can then add rows by using the class’s addRow or addAllRows methods.

### DynamicPickListRows(rows, containsAllRows)

Creates an instance of the VisualEditor.DynamicPickListRows class using the specified parameters.

#### Signature

public DynamicPickListRows(List<VisualEditor.DataRow> rows, Boolean containsAllRows)

#### Parameters

- **rows**: Type: List [VisualEditor.DataRow](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DataRow.htm#apex_class_VisualEditor_DataRow "Contains information about one item in a picklist used in a Lightning component on a Lightning page.") List of picklist items.
- **containsAllRows**: Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.") Indicates if all values of the picklist are included in a type-ahead search query (true) or only those values initially displayed when the list is clicked on (false). A picklist in a Lightning component can display only the first 200 values of a list. If containsAllRows is set to false, when a user does a type-ahead search to find values in the picklist, the search will only look at those first 200 values that were displayed, not the complete set of picklist values.

### DynamicPickListRows(rows)

Creates an instance of the VisualEditor.DynamicPickListRows class using the specified parameter.

#### Signature

public DynamicPickListRows(List<VisualEditor.DataRow> rows)

#### Parameters

- **rows**: Type: List [VisualEditor.DataRow](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DataRow.htm#apex_class_VisualEditor_DataRow "Contains information about one item in a picklist used in a Lightning component on a Lightning page.") List of picklist rows.

### DynamicPickListRows()

Creates an instance of the VisualEditor.DynamicPickListRows class. You can then add rows by using the class’s addRow or addAllRows methods.

#### Signature

public DynamicPickListRows()

## DynamicPickListRows Methods

The following are methods for DynamicPickListRows.

- **[addAllRows(rows)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_addAllRows)**  
    Adds a list of picklist items to a dynamic picklist rendered in a Lightning component on a Lightning page.
- **[addRow(row)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_addRow)**  
    Adds a single picklist item to a dynamic picklist rendered in a Lightning component on a Lightning page.
- **[clone()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_clone)**  
    Makes a duplicate copy of the VisualEditor.DynamicPickListRows object.
- **[containsAllRows()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_containsAllRows)**  
    Returns a Boolean value indicating whether all values of the picklist are included when a user does a type-ahead search query (true) or only those values initially displayed when the list is clicked on (false).
- **[get(i)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_get)**  
    Returns a picklist element stored at the specified index.
- **[getDataRows()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_getDataRows)**  
    Returns a list of picklist items.
- **[setContainsAllRows(containsAllRows)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_setContainsAllRows)**  
    Sets the value indicating whether all values of the picklist are included when a user does a type-ahead search query (true) or only those values initially displayed when the list is clicked on (false).
- **[size()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_size)**  
    Returns the size of the list of VisualEditor.DynamicPickListRows.
- **[sort()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DynamicPickListRows.htm#apex_VisualEditor_DynamicPickListRows_sort)**  
    Sorts the list of VisualEditor.DynamicPickListRows.

### addAllRows(rows)

Adds a list of picklist items to a dynamic picklist rendered in a Lightning component on a Lightning page.

#### Signature

public void addAllRows(List<VisualEditor.DataRow> rows)

#### Parameters

- **rows**: Type: List [VisualEditor.DataRow](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DataRow.htm#apex_class_VisualEditor_DataRow "Contains information about one item in a picklist used in a Lightning component on a Lightning page.") List of picklist items.

#### Return Value

Type: void

### addRow(row)

Adds a single picklist item to a dynamic picklist rendered in a Lightning component on a Lightning page.

#### Signature

public void addRow(VisualEditor.DataRow row)

#### Parameters

- **row**: Type: [VisualEditor.DataRow](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DataRow.htm#apex_class_VisualEditor_DataRow "Contains information about one item in a picklist used in a Lightning component on a Lightning page.") A single picklist item.

#### Return Value

Type: void

### clone()

Makes a duplicate copy of the VisualEditor.DynamicPickListRows object.

#### Signature

public Object clone()

#### Return Value

Type: Object

### containsAllRows()

Returns a Boolean value indicating whether all values of the picklist are included when a user does a type-ahead search query (true) or only those values initially displayed when the list is clicked on (false).

#### Signature

public Boolean containsAllRows()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

A picklist in a Lightning component can display only the first 200 values of a list. If containsAllRows is set to false, when a user does a type-ahead search to find values in the picklist, the search will only look at those first 200 values that were displayed, not the complete set of picklist values.

### get(i)

Returns a picklist element stored at the specified index.

#### Signature

public VisualEditor.DataRow get(Integer i)

#### Parameters

- **i**: Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.") The index.

#### Return Value

Type: [VisualEditor.DataRow](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DataRow.htm#apex_class_VisualEditor_DataRow "Contains information about one item in a picklist used in a Lightning component on a Lightning page.")

### getDataRows()

Returns a list of picklist items.

#### Signature

public List<VisualEditor.DataRow> getDataRows()

#### Return Value

Type: List [VisualEditor.DataRow](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_VisualEditor_DataRow.htm#apex_class_VisualEditor_DataRow "Contains information about one item in a picklist used in a Lightning component on a Lightning page.")

### setContainsAllRows(containsAllRows)

Sets the value indicating whether all values of the picklist are included when a user does a type-ahead search query (true) or only those values initially displayed when the list is clicked on (false).

#### Signature

public void setContainsAllRows(Boolean containsAllRows)

#### Parameters

- **containsAllRows**: Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.") Indicates if all values of the picklist are included in a type-ahead search query (true) or only those values initially displayed when the list is clicked on (false). A picklist in a Lightning component can display only the first 200 values of a list. If containsAllRows is set to false, when a user does a type-ahead search to find values in the picklist, the search will only look at those first 200 values that were displayed, not the complete set of picklist values.

#### Return Value

Type: void

### size()

Returns the size of the list of VisualEditor.DynamicPickListRows.

#### Signature

public Integer size()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### sort()

Sorts the list of VisualEditor.DynamicPickListRows.

#### Signature

public void sort()

#### Return Value

Type: void