In my winform data entry application , I have a combo box set to "Dropdown List" so the user couldn't add any values other than items present in my combo box. but while saving if the user doesn't select any item in the combobox I need to save the form with default value("Mg") , but whenever I try to save it shows the field can't be null as it doesn't accept null values:
what I've tried during (save button click event) 1:
string unitcb = unitComboBox.Text;
finishUOMComboBox.Text = uomtxt;
try2:
finishUOMComboBox.SelectedText = "Mg";
try3:
finishUOMComboBox.ValueMember = "Mg";
try4:
finishUOMComboBox.Text = "Mg";
try5:
finishUOMComboBox.selctedindex = 0;
please help how to save "mg" in the combbox when nothing is selected or it is null while saving.
ComboBoxwith values, can you show that? - Fabio