Clearing a combobox
Posted on 2009-06-29
Hi, I'm using VB2005, WinForms. I have a DataGridView and a set of Controls (i.e. Textboxes, ComboBoxes, etc) on one of my Forms. For the ComboBoxes, I load the data from the DataGridView in the following manner, which works fine - no problem there.
cbxDepartment.SelectedItem = dgvUserList.Rows(intRowIndex).Cells("DepartmentName").Value.ToString
However, once a value has been loaded into the "Text" property of the ComboBox, I cannot clear it to a "blank" value. I can replace it by reloading a new value, but I cannot do the following (it has no effect).
cbxDepartment.Text = String.Empty ' Not working
cbxDepartment.Text = "" ' Not working either
Is there a way to clear the Text value once the ComboBox has a Text value visible?