LinqDataSource and custom filtering

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top