Multicolumn combo box filtering syntax

3 posts, 1 answers
  1. Roberto Wenzel
    Roberto Wenzel avatar
    37 posts
    Member since:
    Sep 2012

    Posted 07 Feb 2011 Link to this post

    I'm trying to set a filter expression for my MultiColumn combo box. I use the following syntax.

    MultiColumnComboBox1.DataSource = DataTable1
    MultiColumnComboBox1.DisplayMember = "Iso2"
    MultiColumnComboBox1.ValueMember = "Iso2"

    MultiColumnComboBox1.MultiColumnComboBoxElement.AutoSizeDropDownToBestFit = True
    Dim fe As FilterExpression        
    fe = New FilterExpression(MultiColumnComboBox1.DisplayMember, FilterExpression.BinaryOperation.AND, GridKnownFunction.StartsWith)
    MultiColumnComboBox1.MultiColumnComboBoxElement.AutoCompleteMode = AutoCompleteMode.SuggestAppend
    MultiColumnComboBox1.AutoFilter = True

    When entering a single letter ito the box, e.g. an "L" the filtered result contains all elements which contains an "L", not only thos which start with an "L". Did I use the parameter GridKnownFunction.StartsWith correctly?
    Any help is appreciated.
    Sincerely Roberto
  2. Answer
    Stefan avatar
    2891 posts

    Posted 10 Feb 2011 Link to this post

    Hello Roberto Wenzel, 

    Thank you for writing.

    You should use FilterDsecriptors to implement the desired functionality. Please consider the following code snippet:

    radMultiColumnComboBox1.MultiColumnComboBoxElement.AutoSizeDropDownToBestFit = True
    Dim descriptor As New FilterDescriptor(radMultiColumnComboBox1.DisplayMember, FilterOperator.StartsWith, "")
    descriptor.IsFilterEditor = True
    radMultiColumnComboBox1.MultiColumnComboBoxElement.EditorControl.Columns(radMultiColumnComboBox1.DisplayMember).FilterDescriptor = descriptor
    radMultiColumnComboBox1.MultiColumnComboBoxElement.AutoCompleteMode = AutoCompleteMode.SuggestAppend
    radMultiColumnComboBox1.AutoFilter = True

    I hope this information addresses your question. Let me know if you need anything else.

    Best wishes,
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
  3. DevCraft R3 2016 release webinar banner
  4. Roberto Wenzel
    Roberto Wenzel avatar
    37 posts
    Member since:
    Sep 2012

    Posted 10 Feb 2011 Link to this post

    Thank you Stefan,
    your code helps me a lot.
    Cheers Roberto
Back to Top