views:

308

answers:

3

I have a ComboBox with the values "open", "closed". According to values changed in the ComboBox, I want to change the DataGrid to display either "open " or "closed" values. How can I do this?

+1  A: 

Your DataGrid can be bound to a DataView. Create different DataViews depending upon the Selected item in the DropDownList (here's an article on how to retrieve the selected item).

Fill a DataTable with your data. Derive different DataViews for the combo states. When the combo changes (enable AutoPostback), select the appropriate DataView and Bind the DataGrid.

Frank Krueger
A: 

You could use RowFilter property of a DataView object binded to the DataGrid.

Alexander Prokofyev
A: 

You can use any of the *DataSource controls and add a control parameter with the ID of the combobox. Turn on autopostback for the combo, and asp.net will automatically call the object datasource with the new open/closed value.

eglasius