dr is a datarowarray. dr(0) is what was returned when i did a datatable.select. I know that only one record will be returned. dtList.Rows.IndexOf(dr(0)) returns the index of that specific datarow in the datatable, which will be the same index in the combobox. If anyone knows an easier, cleaner way to get that index, please share.
I think what happened was that since, by default, a combobox sets itself to index 0, when I tried setting the selectedindex to 0, it didnt consider that a change to update the combobox text. Since i did the .text = "" before i set the selectedindex, it cleared the .text property, then applied the selectedindex = 0, which caused no change to the selectedindex, therefore, the combobox does not update the .text property.
This is the only explanation i can come up with. This is why when i set the selectedindex = 1, the combobox considered that a change to the selectedindex and updated the .text property to the selectedtext, even though i was clearing the .text property before setting the selectedindex = 1.
Since i removed the .text = "" and the default selectedindex is 0, it shows the selectedtext for index 0 in the .text property, which, of course, is what i needed.
What led me to this conclusion is that i put in the combobox_selectedindexchanged event with a msgbox showing me the selectedindex value. When i set the selectedindex = 0, the msgbox popped up twice, both having a 0 value. When i set the selectedindex = 1 or -1, the msgbox popped up three times. Twice with a 0 value and once with either 1 or -1, which tells me that setting the selectedindex to 0 does not cause the selectedindexchanged event to fire to update the combobox when loading, but any other value does.
Maybe someone could give a better explanation of this if i am not making sense.