Hi All
I have another Problem. I am trying to retrieve an object from my combo box through the tag property but it's not having any of it. I populate my setOfCars as a collection like so
This collection is then returned and used to populate a comboBox
I have a override of ToString() in my class Car.
I then want to grab the selected item in the comboBox as an object. Everything that i have tried is failing miserably. Could anyone suggest how i would go about obtaining the object from the comboBox.
I have another Problem. I am trying to retrieve an object from my combo box through the tag property but it's not having any of it. I populate my setOfCars as a collection like so
Code:
foreach (Car car in DBcars)
{
car.Tag = car ;
SetOfCars.Add(car);
}
Code:
foreach (Car car in SetOfCars)
{
cb_Car.Items.Add(car.Tag);
}
I then want to grab the selected item in the comboBox as an object. Everything that i have tried is failing miserably. Could anyone suggest how i would go about obtaining the object from the comboBox.
Comment