G
Guest
Hi guys!
I need a help from you.
I would like to do an autofiltering ComboBox. There is a ComboBox as
DropDown style and its items come from a DataView. Well, when user types on
that control (Text property) it should filter the rows inside using the
DataView.RowFilter property and, in the same time, shows to user its items
(DroppedDown = True) already filtered. I've tried the following:
Private Sub ComboBox1_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyUp
Dim strRowFilter As String
strRowFilter = String.Concat("Name LIKE '%", ComboBox1.Text, "%'")
DataView1.RowFilter = strRowFilter
ComboBox1.DroppedDown = True
End Sub
As you can see, when the users types on ComboBox's Text property the event
KeyUp is raised. Then, its Text content becames a Filter string, eg. "John"
goes "Name LIKE '%John%'" and that string to RowFilter.
My solution for this issue isn't working. When I type the Text I can se the
items but for just the first letter.
Thanks in advance.
I need a help from you.
I would like to do an autofiltering ComboBox. There is a ComboBox as
DropDown style and its items come from a DataView. Well, when user types on
that control (Text property) it should filter the rows inside using the
DataView.RowFilter property and, in the same time, shows to user its items
(DroppedDown = True) already filtered. I've tried the following:
Private Sub ComboBox1_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyUp
Dim strRowFilter As String
strRowFilter = String.Concat("Name LIKE '%", ComboBox1.Text, "%'")
DataView1.RowFilter = strRowFilter
ComboBox1.DroppedDown = True
End Sub
As you can see, when the users types on ComboBox's Text property the event
KeyUp is raised. Then, its Text content becames a Filter string, eg. "John"
goes "Name LIKE '%John%'" and that string to RowFilter.
My solution for this issue isn't working. When I type the Text I can se the
items but for just the first letter.
Thanks in advance.