This is a migrated thread and some comments may be shown as answers.

Multicolumn combo box filtering syntax

2 Answers 115 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Roberto Wenzel
Top achievements
Rank 2
Roberto Wenzel asked on 07 Feb 2011, 08:41 PM
Hello,
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.EditorControl.MasterTemplate.FilterDescriptors.Add(fe)
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 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 10 Feb 2011, 11:55 AM
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,
Stefan
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.
0
Roberto Wenzel
Top achievements
Rank 2
answered on 10 Feb 2011, 04:32 PM
Thank you Stefan,
your code helps me a lot.
Cheers Roberto
Tags
MultiColumn ComboBox
Asked by
Roberto Wenzel
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Roberto Wenzel
Top achievements
Rank 2
Share this question
or