dcsimg
Results 1 to 4 of 4

Thread: [2005] Combobox / Data Bind

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2005
    Location
    Alaska
    Posts
    435

    [2005] Combobox / Data Bind

    I have a combobox tied to a database. It loads CustomerNameLast as the display member and CustomerID as the Value Member.

    Is it possible to have 2 display members shown? As in: CustomerNameLast, CustomerNameFirst (EG: Doe, John)

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    103,877

    Re: [2005] Combobox / Data Bind

    No. There are examples in various places of extended ComboBoxes that add that functionality but the standard ComboBox class won't do it.

  3. #3
    Hyperactive Member Always_Confused's Avatar
    Join Date
    Jun 2006
    Location
    Alabama USA
    Posts
    417

    Re: [2005] Combobox / Data Bind

    Why not have in your data adapter a query like:

    Select CustomerID, LastName, FirstName, LastName + CHAR(9) + FirstName AS LNFN
    From MyTable

    Make LNFN as the display Member and keep CustomerID as your Value Member

    It should then display

    Doe Jane
    Doe John
    etc.

    P.S. DOn't forget to generate the DataSet after making the change.
    Last edited by Always_Confused; Oct 17th, 2007 at 05:47 PM.
    If you find information helpful from any member, please take a second and rate their post. Its a nice gesture of your appreciation.

    "I have not failed 10,000 times. I have successfully identified 10,000 ways that will not work" Thomas Edison

    Do illiterate people get the full effect of Alphabet Soup?

    ADO FAQ 2005-2008 Masked Textbox Patch FoxPro Date MZ Tools Great Free Tool

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2005
    Location
    Alaska
    Posts
    435

    Re: [2005] Combobox / Data Bind

    I just resorted to adding a column called CustomerName, which contains lastname and firstname: "Doe, John".

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width