LinqDataSource and custom filtering

  • Thread starter Thread starter Chris Cichocki
  • Start date Start date
C

Chris Cichocki

I am using a GridView to display a set of data from a LinqDataSource. The
filter the data, I have a dropdown box that allows the user to choose the
column to filter on, plus a text box where they can enter the filter value.
I also have a button labeled "GO" to initiate a postback.

In the Selecting event for the LinqDataSource, I clear the Where parameters
and add in the appropriate parameter based on the value in the dropdown box
with the filter value from the text box. With sorting turned on, clicking on
a column name ends up firing the LinqDataSource.Selecting event which sets up
the query and returns the correct set of results.

I have tried raising the Selecting event from the Click event, but it
doesn't seem to re-bind the data from LinqDataSource.

What is the best way to handle this scenario?

Thanks in advance,
Chris
 
Back
Top