如何使用数据源按需过滤gridview中的数据 [英] How to filter data from gridview on demand by using datasource

查看:142
本文介绍了如何使用数据源按需过滤gridview中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用数据源绑定了gridview,然后如何通过特定的选择couloumn值来过滤它?

I have binded the gridview by using datasource then how to filter from it by perticular selecting couloumn value?

推荐答案

数据网格有一个过滤属性。构建过滤器对象并将其分配给过滤器属性。您不要过滤数据源中的数据......这将导致重大问题。让网格在视图中按照预期进行过滤。



特定数据网格的文档应该包含有关执行此操作的信息。
Data grids have a filter property. Build up a filter object and assign it to the filter property. You DO NOT filter the data at the datasource... That will cause major problems. Let the grid do the filtering in the view like it is supposed to.

The documentation for your specific data grid should have information on doing this.


请阅读我对该问题的评论。



我建议使用 Google [ ^ ]。有很多例子可供选择,例如:

带有过滤器的ASP.NET Gridview [ ^ ]

演练:使用LinqDataSource和GridView控件选择和过滤数据子集 [ ^ ]



你必须尝试做在你提出问题(最小努力)之前的事情,然后当你遇到发布详细问题时回到这里。
Please, read my comment to the question.

I'd suggest to use Google[^]. Tons of examples are available, for example:
ASP.NET Gridview with Filter in Header[^]
Walkthrough: Selecting and Filtering a Subset of Data with the LinqDataSource and GridView Controls[^]

You have to try to do something before you ask a question (minimum effort), then come back here when you get stuck to post detailed question.


这篇关于如何使用数据源按需过滤gridview中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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