I have an Gridview for which I initially programmed an option to use a drop down box with values for filter expressions. It enables to select a subset of records and then choose to select one.
I received a request to allow searching on some fields in a grid view. So I presented a choice to switch between these hard coded filter expressions and selecting a database field and typing in a search string:
If user clicks the radiobutton to Search the controls change to databasefield,searchbox,submitsearch:
My submit search button has this code:
Dim filterExpression As String = DropDownList3.SelectedValue + " LIKE '%" & TextBox2.Text & "%'"
Dim filterparameters As String = "TextBox2.Text"
SqlDataSource1.FilterExpression = filterExpression
The resulting search works very well and switching betwe
View Complete Post