过滤gridview(全选) [英] filtering the gridview (selecting all)

查看:103
本文介绍了过滤gridview(全选)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

我在gridview中显示数据时遇到问题.
我只是通过使用下拉列表过滤了网格视图而完成了.

我的问题是,我想显示所有数据.我不知道该怎么办.

例如.

我有两个下拉菜单.
地位和纪律.

当我全选时.
我想显示所有数据.


希望您能帮帮我.
非常感谢Advance.

-chaosgray-

Hello Guys.

I have problem in showing data in my gridview.
I am just done with filtering my gridview by using dropdown.

My problem is,I want to show all of the data. I dont know how to do it.

For Example.

I have two dropdowns.
status and discipline.

When i select all.
I want to show all of the data.


I hope you can help me.
Thanks a lot in Advance.

-chaosgray-

推荐答案

这是MSDN上非常好的GridView教程:DataTable中.将您的GridView 绑定到DataTable.根据数据的用法和数量,您也可以一次获取所有数据,并使用DataView在服务器端对其进行过滤.查看哪个选项可以提供更好的性能.

希望这可以帮助! :thumbsup:
Here is a very good GridView tutorial on MSDN: Table of Contents: GridView Examples for ASP.NET 2.0[^]

You can write a stored procedure which will accept ''status'' and ''discipline'' as a parameter and get the filtered data from the database into a DataTable. Bind your GridView to the DataTable. Depending on the usage and amount of data, you may also get all data at a time and use a DataView to filter them on the server side. Check out which of option gives you a better performance.

Hope this helps! :thumbsup:


您可以将参数作为下拉值传递,并在过程中检查该参数
将结果绑定到gridview

如果删除的所有选定文本全部设置为all,并将其传递到过程中并检查全部
即,if(@prm =''All'')
然后选择所有列表
其他
乌尔状况


希望对您有帮助.
You can pass the parameter as drop down''s value and check that parameter in procedure
Bind the result into gridview

if the drops selected text is all set the value as all and pass this into procedure and check with this all
ie, if(@prm=''All'')
then select all list
else
Ur condition


Hope this will help you.


这篇关于过滤gridview(全选)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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