I have cascading data-bound combo boxes, however, if the second of the two boxes does not have the value, I am trying to change the data source of the original process to the default selection.
However I am getting errors no matter what I try to do to get the combo box to clear.
cboSubSystem.SelectedIndex = -1
cboSubSystem.DataSource = Nothing
Call cboSubSystem.Items.Clear()
cboSubSystem.DataSource = oSubSystem.EntityList
cboSubSystem.DisplayMember = oSubSystem.ORM.SubSystem_c
cboSubSystem.ValueMember = oSubSystem.ORM.SubSystem_c
I also tried the double set for SelectedIndex like http://support.microsoft.com/default.aspx?scid=kb;en-us;327244
What am I doing wrong? I am sure it is something simple but I cannot get past this.
Thanks in advance.
EDIT:
Found my problem. There was an event routine for index changed that loaded the second combo box. That combo box used the selected index, and apparently that locked the data source enough that I could not clear it. Was able to fix it with a re-arrangement of the refresh process.