Hi
I added the items to the ListBox as the following
Code Snippet
lst.BeginUpdate();
lst.DisplayMember =
"Name";
lst.ValueMember =
"ID";
foreach (MyObject d in MyList)
lst.Items.Add(d);
lst.EndUpdate();
To get the selected item I did the following
Code Snippet
1) MyObject
obj = (MyObject )lst.Items[lst.SelectedIndex];
2) string s = obj.Name;
3) txt.Text = s;
and now when it gets to line 3 the textbox gets the content of "s" andthe it jumps back to line 1 and Ithe error"Unable to cast object of type 'System.String' to type 'MyObject'."
Is this a bug or my head is full with bugs?