Results 1 to 3 of 3

Thread: Combobox.itemdata?

  1. #1

    Thread Starter
    Lively Member markmyb's Avatar
    Join Date
    Nov 2001
    Location
    Alberton - South Africa
    Posts
    108

    Angry Combobox.itemdata?

    in VB 6
    I would use the following SQL statement
    select ID, Desc from X

    get the results and populate a combo box.
    combo.itemdata would = the ID value.

    Now in .Net itemdata has been dropped.

    My work around this was to add a collection for each combobox on the form then
    populate that combo with the resuls from the DB, and population the combo box with the respected collection.

    Is there a better method or have I completely missed the toilet seat?
    Confusios say "Man who run in front of car get tired."

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You can directly bound the dataset obj to the combobox .

  3. #3

    Thread Starter
    Lively Member markmyb's Avatar
    Join Date
    Nov 2001
    Location
    Alberton - South Africa
    Posts
    108
    seems like a long way round...
    Heres the problem i'm facing

    a simple screen layout:
    Group1
    [ combo1 ] [ combo2 ] [ combo3 ]
    [textbox1] [textbox2] [textbox3]

    Group2
    [ combo1 ] [ combo2 ]
    [textbox1] [textbox2]

    group1
    combo2 is populated after combo1.item has been selected
    combo3 same as above exept uses combo2.item

    group2
    follows the same example as above.

    When an item is selected textbox(n) is populated with the ID value.
    If textbox(n).text is entered then the value in combo(n) must
    reflect the correct text.

    In order for me to get this right i've created 5 classes which inherit from a base interface. With all the functionality needed to complete the above mentioned problem.

    Looking at your option:
    How would i implement this using data binding?
    Last edited by markmyb; Aug 14th, 2003 at 01:31 AM.
    Confusios say "Man who run in front of car get tired."

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