So I have this array
string[,] cars = new String[2, 2] {
{ "VW Golf GTI", "30000" },
{ "Porsche GT3", "300000" },
{ "Porsche Cayenne", "80000" },
{ "BMW M6", "90000" }
};
And want to put everything in a listbox, and I thought this would work, but it doesn’t :/
lstBoxMarket.Items.AddRange(cars);
Now how do I put everything in the listbox in the format
Car – Price ?
Try this:
Your version of
carswill not currently compile as you are specifying constants for the array initializers (2 rows by 2 columns) but your data has 4 rows.