I have my collectionOfCar s and my car class.
In my car class i have written
I am trying to write these cars to a listView
this returns me
"carApp.Car "
This isn't the desired outcome i gather that the ToString() override isn't working and i have no idea why. AnyOne have any ideas?
i'm sure it's simple but it is just bugging me now
thanks in advanced
Cheers
Truez
In my car class i have written
Code:
public override string ToString()
{
return String.Format(_carColour + " " + _carMake);
}
Code:
private void FillCarLists(ListView lvi, CollectionOfCars Cars)
{
foreach (Car myCar in CollectionOfCars )
{
ListViewItem test= new ListViewItem(myCar.ToString());
lvi.Items.Add(test);
}
}
"carApp.Car "
This isn't the desired outcome i gather that the ToString() override isn't working and i have no idea why. AnyOne have any ideas?
i'm sure it's simple but it is just bugging me now
thanks in advanced
Cheers
Truez
Comment