>namespace ChristophersCarCenter >{ > public partial class ChristophersCarCenterForm : Form > { > string[,] _crossRefArray = new string[9, 4] > { > {"PR214","MR43T","RBL8", "14K22"}, > {"PR223","R43", "RJ6", "14K24"}, > {"PR224","R43N", "RN4", "14K30"}, > {"PR246","R46N", "RN8", "14K32"}, > {"PR247","R46TS","RBL17Y", "14K33"}, > {"PR248","R46TX","RBL12-6","14K35"}, > {"PR324","S46", "J11", "14K38"}, > {"PR326","SR46E","XEJ8", "14K40"}, > {"PR444","47L", "H12", "14K44"} > }; > > public ChristophersCarCenterForm() > { > InitializeComponent(); > } > > private void ChristophersCarCenterForm_Load(object sender, EventArgs e) > { > CCCListBox.Items.AddRange(_crossRefArray); // <<<---THIS ISN'T WORKING. > } > > private void exitButton_Click(object sender, EventArgs e) > { > this.Close(); > } > } >} > >>
int rows = _crossRefArray.Length / 4; string[] listboxSource = new string[rows]; for (int i = 0; i < rows; i++) { listboxSource[i] = _crossRefArray[i, 0]; } CCCListBox.DataSource=listboxSource;But, on the face of it, I'd favour using a list of objects rather than the _crossRefArray - more flexible.....