Filterable Grid for ASP.NET

Aug 13, 2004

1 min read

.NET1.0

.NET1.1

VS.NET2002

VS.NET2003

VB

ASP.NET

Javascript

Windows

.NET

Visual-Studio

Dev

Intermediate

Author picture

by Hemang Shukla

Contributor

83k Views

Sample Image

Introduction

This article presents an ASP.NET DataGrid with ability to filter based on column values.

Details

I tried to keep the code simple. This code uses JavaScript method filtergrid to build QueryString for the URL. The datasource is filtered based on QueryString values.

JSCRIPT
 

In the code-behind file, the FillDataGridColumns method creates the column headers with HTML textbox and button.

VBNET
   

Scope of further development

  • At present, this control handles String and Double datatypes only. It can be modified to handle other datatypes.
  • Filter works on single value only and can not search for multiple values.

All your suggestions and comments are welcome.

Conclusion

The use of basic JavaScript and code-behind file helps to enhance the functionality of the DataGrid control.

License

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