Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir,

Am using Asp.Net , C# and Database as sqlserver 2005

In My Project, I have a Dropdownlist and a Gridview. When the user Selects one Item From Dropdownlist. The Selected Item all Records must be displayed in Gridview.


For Example Dropdownlist

---- Select -----
Sort by Name
Sort by Date
Active Records(Present Records)
Expire Records(I mean less than system date)

When the User Selects one Item from above dropdownlist...the related records must be displayed in Gridview.

Please Expalin me in detail am in Confusion.

Thanks,
Posted

1 solution

1. Bind the dropdownlist in Page_Load event to the required items from the database.

2. Create a selectedIndexChanged event for dropdown and AutoPostback=true

3. Now in the selectedIndexChanged event, on the server side, get the selected item from the dropdown and pass it as a key to the database to fetch the related items and bind them to the gridview.
 
Share this answer
 
v2
Comments
VJ Reddy 10-Apr-12 11:13am    
Good answer. +5
Syed SufiyanUddin 10-Apr-12 14:22pm    
am fresher to this field , I didnot understand Please can u send me the code...and explain me in detail.
bbirajdar 11-Apr-12 1:48am    
Thank you @VJ Reddy

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