List Item Constructor
Constructor.
Definition
Namespace: EWSoftware.ListControls
Assembly: EWSoftware.ListControls (in EWSoftware.ListControls.dll) Version: 2024.12.31.0
Assembly: EWSoftware.ListControls (in EWSoftware.ListControls.dll) Version: 2024.12.31.0
C#
public ListItem(
Object value,
string text
)VB
Public Sub New (
value As Object,
text As String
)C++
public:
ListItem(
Object^ value,
String^ text
)F#
new :
value : Object *
text : string -> ListItemParameters
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, "Make"));
cboSortOrder.Items.Add(new ListItem(3, "Model"));
cboSortOrder.Items.Add(new ListItem(4, "Part Number"));
cboSortOrder.SelectedIndex = 0;VB
' 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, "Make"))
cboSortOrder.Items.Add(New ListItem(3, "Model"))
cboSortOrder.Items.Add(New ListItem(4, "Part Number"))
cboSortOrder.SelectedIndex = 0C++
No code example is currently available or this language may not be supported.F#
No code example is currently available or this language may not be supported.