Hi guys,
I have a combobox which when the user selects the value, the two text boxes will display the value. It works nice and great, but the user wants it so that when the form loads, that the values are not displayed until the user selects there value from the combobox.
Here is what I am attempting to doCode:cboCaseFileProblemCode.DataSource = dataTable cboCaseFileProblemCode.DisplayMember = "Description" cboCaseFileProblemCode.ValueMember = "ProblemCode" If txtCaseFileProblemCode.DataBindings.Count > 0 Then txtCaseFileProblemCode.DataBindings.RemoveAt(0) End If If txtCaseFileProblemCategory.DataBindings.Count > 0 Then txtCaseFileProblemCategory.DataBindings.RemoveAt(0) End If txtCaseFileProblemCode.DataBindings.Add("TEXT", dataTable, "ProblemCode") txtCaseFileProblemCategory.DataBindings.Add("TEXT", dataTable, "CategoryName") cboCaseFileProblemCode.SelectedIndex = -1
What happens is the combo box is empty, and also the textboxes, but when I select the first item, the two textboxes do no put the values in. But if I select anything other than that It shows the values. Is there a way I can sort this out?Code:cboCaseFileProblemCode.SelectedIndex = -1 txtCaseFileProblemCode.Clear() txtCaseFileProblemCategory.Clear()
Thank you in advance..





Reply With Quote