in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

C1Combo and AutoComplete

Last post 08-30-2007 3:22 PM by loster. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-28-2007 2:10 AM

    • loster
    • Not Ranked
    • Joined on 06-10-2007
    • Posts 6

    C1Combo and AutoComplete

    Hi Guys,

    I'm adding data to two columns in Add Item mode to a C1Combo but for some reason I simply cannot get AutoComplete to work.   Can someone please give me an idiots guide on how to get this to work :)

    Cheers 

     

  • 08-28-2007 9:23 AM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 515

    Re: C1Combo and AutoComplete

    Hi,

    You should only have to set the AutoCompletion property to true.  And there should be data visible in the drop down.  If that's not working, try setting everything else to default or start with a new C1Combo that has only DataMode and AutoCompletion properties changed.

     

    regards,

    Greg L

    Filed under: ,
  • 08-28-2007 12:01 PM In reply to

    • loster
    • Not Ranked
    • Joined on 06-10-2007
    • Posts 6

    Re: C1Combo and AutoComplete

    Hi

    Thanks for the reply,

    I started a new project with just one combo on it and loaded data from a table with the datamode set to Normal and Autocomplete works fine.  When you set the Datamode to Additem mode then Autocomplete stops working :(

     Cheers

     

     

  • 08-28-2007 2:14 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 515

    Re: C1Combo and AutoComplete

    >>When you set the Datamode to Additem mode then Autocomplete stops working :( 

    Just to make sure, when DataMode = AddItem, are you calling the AddItem method in your code to populate the combo? 

    and what version are you running?

    Regards,
    -Greg L 

    Filed under: ,
  • 08-29-2007 1:48 PM In reply to

    • loster
    • Not Ranked
    • Joined on 06-10-2007
    • Posts 6

    Re: C1Combo and AutoComplete

    Hi Greg

    This is the code:

    C1Combo1.DataMode = Global.C1.Win.C1List.DataModeEnum.AddItem

    C1Combo1.ClearItems()

    C1Combo1.AddItemCols = 2

    C1Combo1.Columns(0).Caption = "CustNo"

    C1Combo1.Columns(1).Caption = "Customer"

    C1Combo1.DisplayMember = "Customer"

    C1Combo1.AutoCompletion = True

    C1Combo1.MatchCol = C1.Win.C1List.MatchColEnum.DisplayMember

    C1Combo1.MatchEntry = C1.Win.C1List.MatchEntryEnum.Extended

     

    C1Combo1.Splits(0).DisplayColumns(0).Visible = False

    C1Combo1.Splits(0).DisplayColumns(0).Width = 10

    C1Combo1.Splits(0).DisplayColumns(1).Width = C1Combo1.Width - 10

    Version Number is:

    2.1.20072.123

    Cheers 

     

     

     

  • 08-30-2007 1:40 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 515

    Re: C1Combo and AutoComplete

    It looks like you are binding your Combo to a datasource.  If so, you have to keep DataMode to Normal, because AddItem mode is for unbound Combos that are populated using the AddItem method.  I don't see you using the AddItem method so I assume you have a datasource. 

    Also make sure the DisplayMember matches the field from the datasource.  Try this code for that line:

    C1Combo1.DisplayMember = C1Combo1.Columns(1).DataField

    Hope that helps
    -Greg L

  • 08-30-2007 3:22 PM In reply to

    • loster
    • Not Ranked
    • Joined on 06-10-2007
    • Posts 6

    Re: C1Combo and AutoComplete

     

    Hi Greg

    The line

    C1Combo1.DisplayMember = C1Combo1.Columns(1).DataField

    Has fixed the problem, many thanks for all your hard work.

    Cheers 

     

Page 1 of 1 (7 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.