CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Dec 2011
    Location
    .Net 4.0
    Posts
    39

    [RESOLVED] Combobox for Multiple columns; 1 column visible

    I want the combobox control effect to provide a drop-down list of Customers. However, I need to make sure that each combobox.item relates to a customer in the database.

    I wanted to be able to store (or otherwise associate) CustomerID with each combobox.item, where the items will only be the customer names. That way, when a customer is chosen by name, I will readily know the CustomerID.

    I can run an array side-by-side (parallel to) the combobox if needed, but maybe someone knows a better way.

    Thanks.

    NM. The best method is to create a Class to allow combobox1.DisplayMember and comboBox1.Valuemember to be set to the Class's properties of ID and Name.
    Last edited by JeffInTexas; December 16th, 2011 at 08:23 PM.

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

Featured