Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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-
Posted
Updated 22-May-11 20:34pm
v3

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:
 
Share this answer
 
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.
 
Share this answer
 
v2

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