Results 1 to 3 of 3

Thread: [2005] ComboBox & DataBinding

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    207

    [2005] ComboBox & DataBinding

    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.

    Code:
            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
    Here is what I am attempting to do

    Code:
            cboCaseFileProblemCode.SelectedIndex = -1
            txtCaseFileProblemCode.Clear()
            txtCaseFileProblemCategory.Clear()
    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?

    Thank you in advance..
    Last edited by TURKINATOR; Jul 9th, 2008 at 10:07 AM.
    Rate me if my response helped you. If not, I accept charity Rates as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width