Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
What is the best way to create a filterable gridview with drobdown lists and searchbox :

1- Create multiple datasource and link each filter to it
2- change select statement for gridview datasource (problems in post back on row delete and inputs values)
3- suggest me any other

thanks
Posted

1 solution

1.In my ASP.NET projects for each grid view I used the Entity Framework and Stored Procedure (shortly SP) with filter parameters, so the WHERE clause is dynamically build inside of the SP by using these filter parameters.

You could see details (and source code) about this technique in my next article Advanced ASPX GridView Pagination and Data Entities[^]

2. Other solution, without SP, could be to dynamically create LINQ query based on the filter parameters. I am using this technique in my new ASP.NET MVC projects.
 
Share this answer
 
Comments
Hidhoud1991 1-Sep-14 8:21am    
Ill Check it out thanks :)
Raul Iloc 3-Sep-14 2:13am    
So, did you check it out?
Hidhoud1991 3-Sep-14 2:17am    
it is mvc im not familiar with it ... i used the store procedure .. its doing the job .. thanks anyway
Raul Iloc 3-Sep-14 2:22am    
My indicated article is not about MVC, it is classical ASP.NET web application, and I provide there also stored procedure code for filtering and pagination that could be customized/extended.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900