Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I'm very new to asp.net.

I'm facing a problem; by placing two dropdownlists above the gridview, the records have to change according to the text selected from the dropdownlists.
Posted
Updated 16-May-11 22:47pm
v2
Comments
Dalek Dave 17-May-11 4:47am    
Edited for Grammar and Readability.

just write a Selection_change event of both DropDownList, make one property of both DropDownList -- AutoPostBack = true...
now whenever you select an item from DropDownList, related Selection_Change event will be fire...
so write your code there to fire a query as per need and bind the data to the GridView...
 
Share this answer
 
Comments
Dalek Dave 17-May-11 4:47am    
Good Call
parmar_punit 17-May-11 4:54am    
Thanks
 
Share this answer
 
Comments
Dalek Dave 17-May-11 4:47am    
Good Links
ambarishtv 17-May-11 5:11am    
thank you Dave :)
put autopostback=true in dropdownlist properties and handle the event selectionindexchanged

in that one bind gridview like

sqldataadapter da=new sqldataadapter(&quot;select * from tname where colname=&quot;+ddl1.selectedvalue,cn);</pre>
 
Share this answer
 

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