Filter a gridview with a SQLDataSource using a checkbox
Posted on 2006-03-22
I have a gridview with a SQL Datasource. I am trying to filter my gridview with a checkbox. I want to use this checkbox to filter out my records. i.e. when it is not ticked I would like my gridview to show the results from the following query.
SELECT * FROM Products WHERE supplierID = 1
and when it is ticked I would like my gridview to show.
SELECT * FROM Products WHERE (supplierID = 1) AND (UnitPrice < 10 OR UnitPrice IS NULL)
I would prefer to do this with a paramaterised query but I am not sure how or whether it is even possible.
Thanks in advance for your help.