ListItem(Object, String) Constructor

Constructor

Definition

Namespace: EWSoftware.PDI
Assembly: EWSoftware.PDI (in EWSoftware.PDI.dll) Version: 2023.1.2.0
public ListItem(
	Object value,
	string text
)

Parameters

value  Object
The value for the item
text  String
The display text for the item

Remarks

Pass it the value and display text to use for the item. If the display text is null, it will be set to the string representation of the value.

Example

C#
// Set the sort order values using ListItem objects
cboSortOrder.DisplayMember = "Display";
cboSortOrder.ValueMember = "Value";
cboSortOrder.Items.Add(new ListItem(1, "Item Description"));
cboSortOrder.Items.Add(new ListItem(2, "Maker"));
cboSortOrder.Items.Add(new ListItem(3, "Model"));
cboSortOrder.Items.Add(new ListItem(4, "Part Number"));
cboSortOrder.SelectedIndex = 0;

See Also