Click here to Skip to main content
15,887,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to display gridview based on the selected value in drop down list im using asp.net 3.4 version vs2008
Posted

I can give you the Idea only, because you havnt tried for it.....

1) First of all write a function to bind gridview say BindData()

2) Call it from pageload in if(!Page.IsPostBack). So it will not get called on every postback event.

3) Call the same function from the Dropdownlist's SelectedIndexChange Event.

4) Put your dropdownlist's autopostback property to true. So it will postback to the server.

In case of any question, reply back in comment.......:)
 
Share this answer
 
Check the same type of discussion here[^]
 
Share this answer
 
hi.

first. you should get the data source of the gridview.
second. select database, then select connection.
third. you select statement.
fourth. you will see from the selecting statemet the button "WHERE"
fifth. you will see a dropdown there. then choose a column you are being control by your dropdown, then another dropdown will appear, select "=". then you will choose a source. select. "control". then you will see the "parameter properties" select you dropdown id. then select add.


and that's it!.

hope it helps.
goodluck. :)



-chaosgray-
 
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