为gridview创建搜索过滤器的最佳方法是什么 [英] What is the best way to create a search Filter for a gridview

查看:71
本文介绍了为gridview创建搜索过滤器的最佳方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用drobdown列表和搜索框创建可过滤的gridview的最佳方法是什么:



1-创建多个数据源并将每个过滤器链接到它

2-更改gridview数据源的select语句(回删行和输入值的问题)

3-建议我任何其他



谢谢

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

推荐答案

1.在每个网格视图的ASP.NET项目中,我使用了实体框架存储过程(简称SP)带有过滤器参数,因此 WHERE 子句是在SP内部动态构建的通过使用这些过滤器参数。



您可以在我的下一篇文章中看到有关此技术的详细信息(和源代码)高级ASPX GridView分页和数据实体 [ ^ ]



2.其他解决方案,没有SP,可以基于过滤器参数动态创建LINQ查询。我在我的新ASP.NET MVC项目中使用这种技术。
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.


这篇关于为gridview创建搜索过滤器的最佳方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆