Okay so I am writing some C# and the program at one point reads in a file and stores each line in a string array. This part of the code works I have tested it. Well then I have the string displayed in a listBox with this string array using
listBox1.DataSource = storedFileArray; //storedFileArray is the string array
Well then I go onto a checkedBoxList and try doing the same thing but using the line
checkedListBox1.Items.AddRange(shiftTypeArray)
//their in different classes
The only problem is no matter what I try I can't get more then one line (see link for screen)
http://i109.photobucket.com/albums/n65/Vin_diesalxxx/addEmployeecheckedBox.jpg
I have tried almost everything to get this to work like
string transfer = shiftTypeIn[0];
checkedListBox1.Items.AddRange(transfer)
string transfer2 = shiftTypeIn[1];
checkedListBox1.Items.AddRange(transfer)
...
And still it displays like the screenshot shows (NOTE: If I was to display the string variables transfer or transfer2 as a MessageBox they display the line of text fine). I have tried a for loop of .Add(shiftTypeIn) and have no luck. I can't get this to work. I am not brand new to C# but I still have alot to learn, so any help can help.
Oh also I tried a test and did a code like this
string [] values = {"1", "2", "3"};
checkedListBox1.Items.AddRange(values)…
This code works fine. Now the reason I read from a file is because the part of the code that has the listBox allows the user to add or remove (well their shifts) and then the changes are saved to a txt file, then tee file can be read in (from that delegate call) so I can save them when the program closes. Thanks again to anyone who can help I really need it, I have been looking at this for hours. (Also if you would like to see more of the code I am more then willing to show you)