Hallo,
I have this code today:
dv = new DataView(ds.Tables[0]);
cbo.DataSource = dv;
cbo.DisplayMember = "DESCRIPTION";
cbo.ValueMember = "ID";
This gives me a combobox / DropDownList which always choose a value. Since the combobox is optional, this needs to be changed, so that the default top value always is " " (empty). I tried adding SelectedIndex = -1, and this gives the wanted result, but if user by accident choose a value, and then want to go back, the is no " " (empty) value to choose.
Can this be achieved without adding an empty value to my database??
Thx in advance!
Best regards,
Eirik Hesthamar
Norway
I have this code today:
dv = new DataView(ds.Tables[0]);
cbo.DataSource = dv;
cbo.DisplayMember = "DESCRIPTION";
cbo.ValueMember = "ID";
This gives me a combobox / DropDownList which always choose a value. Since the combobox is optional, this needs to be changed, so that the default top value always is " " (empty). I tried adding SelectedIndex = -1, and this gives the wanted result, but if user by accident choose a value, and then want to go back, the is no " " (empty) value to choose.
Can this be achieved without adding an empty value to my database??
Thx in advance!
Best regards,
Eirik Hesthamar
Norway