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

I have a Grid View that connected to DB with DataSource.
The DataSource have a query that selects items from the DB that have a specific ID.

also, I have a DropDown-List and I want to update the query of the dataSource so when the user selects some index from the DropDown-List it will show the relevant data in the Grid View .

Please Help!

Updated 29-Aug-12 3:00am

1 solution

Use BindingSource.Filter to filter your dataGridView.

change the filter in DropDownList_SelectedIndexChanged.
Share this answer
mishkaPishka 29-Aug-12 9:02am    
Can you please attach any code example?

mishkaPishka 29-Aug-12 9:16am    
by the way,
I'm using and not win form
[no name] 29-Aug-12 9:53am    
Set AutoPostBack true.

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