Regrads.
In my proyect i'm using a MultiColumnComboBox control with data Source, but the table have very much information. In the moment when user is writing the MultiColumnComboBox begin filtering, but this teke several time to search the data. i use the next code to filter: (vb.net)
Sub conf_combo_pacientes()
Me.tb_identificacion.AutoFilter = True
Me.tb_identificacion.DisplayMember = "Identificación"
Dim filter As New FilterDescriptor()
filter.PropertyName = Me.tb_identificacion.DisplayMember
filter.[Operator] = FilterOperator.Contains
Me.tb_identificacion.EditorControl.MasterTemplate.FilterDescriptors.Add(filter)
tb_identificacion.MultiColumnComboBoxElement.EditorControl.EnableCustomFiltering = True
AddHandler tb_identificacion.MultiColumnComboBoxElement.EditorControl.CustomFiltering, AddressOf EditorControl_CustomFilteringrl
AddHandler tb_identificacion.KeyDown, AddressOf TB_CEDULA_RL_KeyDown
tb_identificacion.DropDownSizingMode = SizingMode.UpDownAndRightBottom
tb_identificacion.AutoSizeDropDownToBestFit = True
End Sub
Private Sub EditorControl_CustomFilteringrl(sender As Object, e As Telerik.WinControls.UI.GridViewCustomFilteringEventArgs)
Dim element As RadMultiColumnComboBoxElement = tb_identificacion.MultiColumnComboBoxElement
Dim textToSearch As String = tb_identificacion.Text
If AutoCompleteMode.Append = (element.AutoCompleteMode And AutoCompleteMode.Append) Then
If element.SelectionLength > 0 AndAlso element.SelectionStart > 0 Then
textToSearch = tb_identificacion.Text.Substring(0, element.SelectionStart)
End If
End If
If String.IsNullOrEmpty(textToSearch) Then
e.Visible = True
For i As Integer = 0 To element.EditorControl.ColumnCount - 1
e.Row.Cells(i).Style.Reset()
Next
e.Row.InvalidateRow()
Return
End If
e.Visible = False
For i As Integer = 0 To element.EditorControl.ColumnCount - 1
Dim text As String = e.Row.Cells(i).Value.ToString()
If text.IndexOf(textToSearch, 0, StringComparison.InvariantCultureIgnoreCase) >= 0 Then
e.Visible = True
e.Row.Cells(i).Style.CustomizeFill = True
e.Row.Cells(i).Style.DrawFill = True
e.Row.Cells(i).Style.BackColor = Color.FromArgb(201, 252, 254)
Else
e.Row.Cells(i).Style.Reset()
End If
Next
e.Row.InvalidateRow()
End Sub
Private Sub tb_identificacion_KeyDown(sender As Object, e As KeyEventArgs) Handles tb_identificacion.KeyDown
Try
If e.KeyCode = System.Windows.Forms.Keys.Enter Then
If Me.tb_identificacion.ValueMember <> "" Then
tb_identificacion.SelectedValue = tb_identificacion.EditorControl.CurrentRow.Cells(tb_identificacion.ValueMember).Value
Else
tb_identificacion.SelectedValue = tb_identificacion.EditorControl.CurrentRow.Cells(tb_identificacion.DisplayMember).Value
End If
tb_identificacion.Text = tb_identificacion.EditorControl.CurrentRow.Cells(tb_identificacion.DisplayMember).Value.ToString()
tb_identificacion.MultiColumnComboBoxElement.ClosePopup()
tb_identificacion.MultiColumnComboBoxElement.TextBoxElement.TextBoxItem.SelectAll()
End If
Catch ex As Exception
End Try
End Sub
While the user is writing, then control is filtering but I do not want it so, i woluld like that the user to write but when user press key intro, in this moment the multiColumnComboBox is filtering. But i don't know do it.