Welcome to the Xceed Community Sign in | Join | Help
Community Search  

SearchMode in WinComboBox?

Sort Posts: Previous Next
  •  07-30-2008, 11:37 AM Post no. 13808

    SearchMode in WinComboBox?

    Are there any other options for SearchMode in the WinComboBox? We're trying to allow a softseek/drilldown functionality where they start typing and it gets closer and closer to the value. Imagine this scenario.

    You have these 4 numbers in the list

    100
    120
    200
    220

    If I start typing a 1 it should highlight 100, if I then typed a 2 it will highlight 120. But if I typed a 3 instead it would unhighlight everything. When we're dealing with thousands of very similar numbers the first character seek just isn't good enough.

    Let me know if you guys have any ideas.

    Thanks,

    Nathan

  •  08-05-2008, 4:12 PM Post no. 13906 in reply to 13808

    Re: SearchMode in WinComboBox?

    You will need to use a custom auto-complete source to do this.  Adding to your example, you can do something like the following : 

    AutoCompleteStringCollection coll = new AutoCompleteStringCollection();

    coll.AddRange( new string[] { "100", "120", "200", " 220" } );

    winComboBox1.TextBoxArea.AutoCompleteMode = AutoCompleteMode.Append;

    //or, depending on how you want to display the suggested items, you can use the following instead

    winComboBox1.TextBoxArea.AutoCompleteMode = AutoCompleteMode.SuggestAppend;

     

    winComboBox1.TextBoxArea.AutoCompleteSource = AutoCompleteSource.CustomSource;

    winComboBox1.TextBoxArea.AutoCompleteCustomSource = coll;

     


    André
    Software Developer and Tech Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.