Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Combo box does not display a value

$
0
0

I am trying to set the value of a combo box like so:

cmbStatePlate.Text = a.PlateState;

where platestate is actually a string.

This was working before and now the combobox remains empty after this line.

The weird thing is if I trigger a click event somewhere else to pop up a messagebox with combobox.text it displays the string. I checked my code to see if it is being set blank anywhere and it is not. I also set another click event to set the combobox with a hardcoded value and it still would not display the value. It does however display the value in a double click event which I have tied to a gridview.. 

cmbStatePlate.Text = grdSearch.CurrentRow.Cells["PlateState"].Value.ToString();

Any ideas??

I even deleted the combobox and dragged a new one in but no go. 


Viewing all articles
Browse latest Browse all 12583

Trending Articles