ComboBox problem?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kirsten
    New Member
    • Feb 2008
    • 19

    ComboBox problem?

    I’m using VS 2008
    I have a bound ComboBox on a form.
    It is bound to a tblInvoiceHeade r. VendorID, and it shows the VendorName. When clicked it displays a list of Vendors. When one is selected it is suppose to put the VendorID into this field.

    When the form opens it displays the correct vendor (the one whose VendorID = the VendorID in this textbox), but when I change the selection it remains stuck in this ComboBox, I can’t do anything else on the form, nothing responds other than the combobox but no matter what I do in the combobox I can’t exist it.

    The Combo is setup as such:
    Data Source – a binding source that is connected to the VendorDS
    Display Member - VendorName
    Value Member – VendorID
    All these are from the VendorDS.tblVen dor
    Selected Value – InvoiceHeaderBi ndingSource.Ven dorID ( I have tried changing this the dataset.table but it makes no difference to this behavior)
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Originally posted by Kirsten
    I’m using VS 2008
    I have a bound ComboBox on a form.
    It is bound to a tblInvoiceHeade r. VendorID, and it shows the VendorName. When clicked it displays a list of Vendors. When one is selected it is suppose to put the VendorID into this field.

    When the form opens it displays the correct vendor (the one whose VendorID = the VendorID in this textbox), but when I change the selection it remains stuck in this ComboBox, I can’t do anything else on the form, nothing responds other than the combobox but no matter what I do in the combobox I can’t exist it.

    The Combo is setup as such:
    Data Source – a binding source that is connected to the VendorDS
    Display Member - VendorName
    Value Member – VendorID
    All these are from the VendorDS.tblVen dor
    Selected Value – InvoiceHeaderBi ndingSource.Ven dorID ( I have tried changing this the dataset.table but it makes no difference to this behavior)
    What event(s) are you using with the combobox? Better to display the error.

    Comment

    • Kirsten
      New Member
      • Feb 2008
      • 19

      #3
      I am not using any events with it, nor am I getting any error.


      Originally posted by kenobewan
      What event(s) are you using with the combobox? Better to display the error.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Is this combobox supposed to be "updating" the value back in it's datasource?
        I would imagine if it were trying to do that whenever it lost focus, and won't give up focus until the datasource says "yeah, I updated it", that it will get stuck there if the datasource does not acknowledge the action.

        Comment

        • Kirsten
          New Member
          • Feb 2008
          • 19

          #5
          Yes it is suppose to be updating the DataSource.
          But why would that matter or make a problem?


          Originally posted by Plater
          Is this combobox supposed to be "updating" the value back in it's datasource?
          I would imagine if it were trying to do that whenever it lost focus, and won't give up focus until the datasource says "yeah, I updated it", that it will get stuck there if the datasource does not acknowledge the action.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            Originally posted by Kirsten
            Yes it is suppose to be updating the DataSource.
            But why would that matter or make a problem?
            For the exact reasons I just stated. Is the datasource updating itself correctly?
            Attach an event handler to the selected item changer then set a breakpoint.
            Step through and keep an eye on the datasource with the watch window.
            See if changes have been updated?

            Comment

            • Kirsten
              New Member
              • Feb 2008
              • 19

              #7
              Thanks for your help.
              I resolved the problem which was the DataBinding.Tex t had a value and when I removed it now it's working.

              Originally posted by Plater
              For the exact reasons I just stated. Is the datasource updating itself correctly?
              Attach an event handler to the selected item changer then set a breakpoint.
              Step through and keep an eye on the datasource with the watch window.
              See if changes have been updated?

              Comment

              Working...