C
Cralis
I have a List of data objects.
I need to populate a ComboBox with the 'Description' field from the
objects.
I can do that with cmbBx.Items.Add( myObject.Description.ToString() );
myObject has 2 fields for example. id and description.
Later, I need to get the id of the selected item in the ComboBox...
In Delphi, I'd create a StringList, and add the ID to that, and then
just match up the index of the combobox with the corrasponding index
of the StringList to objtain the selected descriptions ID.
Is there a better way to do this in C#?
I need to populate a ComboBox with the 'Description' field from the
objects.
I can do that with cmbBx.Items.Add( myObject.Description.ToString() );
myObject has 2 fields for example. id and description.
Later, I need to get the id of the selected item in the ComboBox...
In Delphi, I'd create a StringList, and add the ID to that, and then
just match up the index of the combobox with the corrasponding index
of the StringList to objtain the selected descriptions ID.
Is there a better way to do this in C#?