public static void BindeNumToList(System.Windows.Forms.ListControl
theControl, Type EnumType)
{
theControl.DataSource = eNumByDescriptionAsDataTable(EnumType);
theControl.DisplayMember = "Displays";
theControl.ValueMember = "Values";
}
where eNumByDescriptionAsDataTable is a method which generates a simple
datatable with a "Values" column and a "Displays" column from an eNum type.
The code which tries to find the value of the combobox looks like this:
DataRowView SelectedRow = (DataRowView)KitUsedBox.SelectedValue;
KitUsed TheKit = (KitUsed)int.Parse(SelectedRow[0].ToString());
// KitUsed TheKit =
(KitUsed)int.Parse(KitUsedBox.SelectedValue.ToString());
The uncommented part sometimesworks and sometimes throws errors. When I
switch and just have the part the is currently commented, I get the same
general behavior. Sometimes works, sometimes throws errors.
Thanks for your help!
Ethan
Ethan Strauss Ph.D.
Bioinformatics Scientist
Promega Corporation
2800 Woods Hollow Rd.
Madison, WI 53711
608-274-4330
800-356-9526
ethan.strauss atsign promega.com
On May 16, 5:08 am, Ethan Strauss