one of experts-exchange member, Tuyau2poil, has help me, and give this code to filter gridview column with two, or more checkboxes in one CheckBoxList1
This code is working only to filter one column FirstName with CheckBoxList1. How can I add also another CheckBoxList2 to filter column SecondName, and for example third CheckBoxList3 to filter third column City????
dim MyFilter as string = ""
Dim i As Integer
For i = 0 To CheckBoxList1.Items.Count - 1
If CheckBoxList1.Items(i).Selected Then
If MyFilter = "" then
MyFilter = " WHERE FIRSTNAME like '%" & CheckBoxList1.Items(i).Text & "%'"
MyFilter = MyFilter & " OR FIRSTNAME like '%" & CheckBoxList1.Items(i).Text & "%'"
SqlDataSource1.SelectCommand = "SELECT * FROM MAIN " & MyFilter
Thank you in advance for help.