Needs to get the name from a List<> to be written in a richtextbox
I am trying to get the name from some goods added on a List<>. These names have to be written in a richtextbox, but I can't get fixed. I can see that I'm on the right direction, because it gets all the goods i want, but it just can't write the name in the box.
All i can see when Im debugging is:
Mandag Navn:
Navn: Navn: Navn: Navn: Navn: Navn: Navn: Navn:Hope someone helps me. Thx!
开发者_如何学Python richTextBox_lister.Clear();
string listenavn = comboBox1.Text;
int listenr = Convert.ToInt32(ictrInd.GetListeNr(listenavn));
Indkøbsliste indkø = ictrInd.findIndkøbsliste(listenr);
listofIndk = ictrInd.getListerIndkøb(indkø);
int i;
string s;
s = comboBox1.Text +"\n";
for (i =0; i <= (listofIndk.Count -1); i++)
{
s = s + "Navn: " + listofIndk[i].Navn + "\n";
}
richTextBox_lister.Text = s;
If this compiles the only possibility is that the properties "Navn" are empty / uninitialized. Check in the method ictrInd.getListerIndkøb(indkø) with the debugger if "Navn" is set. Otherwise post more code.
精彩评论