5,696,576 members and growing! (12,895 online)
Email Password   helpLost your password?
Web Development » ASP.NET Controls » Grid Controls License: The Code Project Open License (CPOL)

GridView Multiple Filter Ajax Control

By tawammar

Ajax control to filter the data in a GridView control by adding filters to the GridView at runtime
C# (C# 1.0, C# 2.0, C# 3.0, C#), .NET (.NET, .NET 2.0)

Posted: 14 Jun 2008
Updated: 14 Jun 2008
Views: 10,447
Bookmarked: 26 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
votes for this Article.
Popularity: 0.00 Rating: 0.00 out of 5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article
FilterDemo1.PNG

FilterDemo2.PNGIFilterDemo3.PNG

Introduction

Ajax Control that enables the user to filter the data within any Column inside a GridView.

The user can add multiple filters and can delete and existed one.

Source Code and Video

I uploaded the source code and a flash video for how to use the control inside your web application.

to run the video you have to have flash plug-in in your browser. drag and drop the SWF file inside your browser and it will run.

http://tawatech.blogspot.com/2008/06/aspnet-datagridview-ajax-data-filter.html

Background

I was looking for an ASP.net 2.0 custom control that enables the user to filter the data in a GridView control by adding filters to the GridView. The control 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, it is a straightforward method:

1- Add web.config ajax tags to enable Ajax in your website.

Conf1.png

Conf2.png

Conf3.png

2- Drag and Drop the filter control in your page. (note: the control is already has Ajax UpdatePanel and ScriptManager, you don't have to to create a new update panel for the control);

ControlPage.png

3- Drag and Drop UpdatePanel for the GridView

4- Place a GridView inside the Ajax UpdatePanel and specify the SQLDataSource for it.

TestPage.png

note: The control already has ScriptManager, so you don't have to create one in your aspx page;

5- 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.

Page_Load.png

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

License

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

About the Author

tawammar



Occupation: Web Developer
Location: Jordan Jordan

Other popular ASP.NET Controls articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 1 of 1 (Total in Forum: 1) (Refresh)FirstPrevNext
Generalc# Sources ?memberDavid Zenou0:54 22 Jul '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 14 Jun 2008
Editor:
Copyright 2008 by tawammar
Everything else Copyright © CodeProject, 1999-2008
Web13 | Advertise on the Code Project