In my opinion:
1st-> U have to create a function to filter.Like this
Private Function GetFilterQuery() As String
Dim FilterString As String = ""
Dim ValueString As String
ValueString = UrTextBoxName.Text.Trim
If ValueString <> "" Then
FilterString = GetQueryWithLogic(FilterString, "TextBoxValue LIKE '%" + ValueString + "%'")
End If
Return FilterString
End Function
Logic of GetQueryWithLogic
Public Function GetQueryWithLogic(ByVal InputQuery As String, ByVal QueryForProcess As String) As String
If (QueryForProcess = "") Then
Return InputQuery
Else
If InputQuery = "" Then
Return QueryForProcess
Else
Return InputQuery + " AND " + QueryForProcess
End If
End If
End Function
2nd:Create this
Public Sub FilterOutDataViewData(ByRef Dv As DataView, ByVal RowFilter As String)
If Dv Is Nothing Then Exit Sub
Dv.RowFilter = RowFilter
End Sub
Now create a event for textchanged
Private Sub TxtFilter_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles urtextBoxName.TextChanged,
Try
RenfroCommonModule.FilterOutDataViewData(DV, GetFilterQuery())
Catch ex As Exception
End Try
End Sub
Quote:
and on the event of urtextbox property select textchanged event and add TxtFilter_TextChanged