Click here to Skip to main content
12,302,764 members (77,594 online)
Click here to Skip to main content
Add your own
alternative version


94 bookmarked

GridView Multiple Filter AJAX Control

, 14 Jun 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
An AJAX control to filter data in a GridView control by adding filters to the GridView at runtime.





This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.

Source Code and Video

I have uploaded the source code and a Flash video on how to use the control inside your web application, on my blog. To run the video, you have to have the Flash plug-in in your browser. Drag and drop the SWF file inside your browser and it will run:


I was looking for an ASP.NET 2.0 custom control that enables the user to filter data in a GridView control by adding filters to the GridView. Similar controls can be found in applications such as Microsoft BI Studio. So I decided to develop a web based control that will do such thing.

Using the Code

To use the control is very straightforward:

  1. Add web.config AJAX tags to enable AJAX in your website:
  2. Drag and drop the filter control in your page. (Note: the control already has the AJAX UpdatePanel and ScriptManager, you don't have to create a new UpdatePanel for the control.)


  3. Drag and drop an UpdatePanel for the GridView.
  4. Place the GridView inside the AJAX UpdatePanel and specify the SQLDataSource for it.
  5. TestPage.png

    Note: The control already has a ScriptManager, so you don't have to create one in your ASPX page.

  6. On Page_Load, specify the DataSource and DataColumns for the filter control and specify the event handler method that will be called after adding or removing the filter.
  7. Page_Load.png

  8. Calling the control method FilterDataSource() in the event handler tableFilter_OnRefresh() will apply the filter on the SqlDataSource1 that you have assigned to the GridView.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
Jordan Jordan
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionMy vote of 5. Pin
Member 103849148-Oct-14 20:53
memberMember 103849148-Oct-14 20:53 
GeneralMy vote of 5 Pin
hadi552610-Jul-12 19:31
memberhadi552610-Jul-12 19:31 
QuestionVB.Net Code Pin
Onyebuchim6-Mar-12 23:55
memberOnyebuchim6-Mar-12 23:55 
QuestionMy vote is 5 Pin
muhamd yusuf21-Feb-12 20:26
membermuhamd yusuf21-Feb-12 20:26 
GeneralMy vote of 5 Pin
eshaq13-Jun-11 11:42
membereshaq13-Jun-11 11:42 
Generalpopulate Gridview with Multiple Filter Options !! Pin
rocky81122-Apr-10 5:38
memberrocky81122-Apr-10 5:38 
GeneralNice work Pin
haitham hamed housin15-Apr-10 14:33
memberhaitham hamed housin15-Apr-10 14:33 
Generaldatabinding Pin
ykpatel29-Sep-09 3:21
memberykpatel29-Sep-09 3:21 
QuestionNew release? Pin
angel.escamilla6-Apr-09 18:24
memberangel.escamilla6-Apr-09 18:24 
Questionc# Sources ? Pin
David Zenou21-Jul-08 23:54
memberDavid Zenou21-Jul-08 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160530.1 | Last Updated 15 Jun 2008
Article Copyright 2008 by tawammar
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid