Click to See Complete Forum and Search --> : Changing RowFilter From Multiple DropDownLists


Ramdu
January 2nd, 2009, 01:42 PM
Hi,

I'm a brand spanking new Web Developer updating someone else's code. Using ASP.NET 2.0

I have a data table stored in a ViewState. The ViewState contains details for multiple products. Some features (columns) are shared by all products and some products only share one or two features. I am able to display all features for all products when I initially load my .aspx page.

When the page loads for any product (determined by a product Series number retrieved from the query string), either two or three DropDownLists also loaded to give selection options for each product's shared features (columns). Currently, when a selection is changed, the code attempts to define a RowFilter based upon the detail selected (e.g. Horsepower, Volume, Crank Size). As I said, some products have all three features (Horsepower, Volume, Crank Size) while others only have two of the three.

My problem is that I cannot get the Selection_Changed code to properly define a new RowFilter based on the new selection in the DropDownList. (I am using a Gridview in an UpdatePanel bound to my saved ViewState).

When the page first loads, all the DropDownLists are set to show "All" by default. I want each DropDownList to function independently of the others or in combination with the others. Right now, if I have all three DropDownLists visible, the first and third only work if I make a selection from the second. For example, Horsepower and Crank Size do not work unless I first select Volume. I do not want this behavior. I want to be able to select any of the three DropDownLists and see a change in the corresponding rows.

Also, if I make selection changes and then attempt to go back to showing "All", my GridView disappears on PostBack and I have a blank white screen staring me in the face. I know this is some kind of logic problem in the way my DropDownLists are set up to define the RowFilter.

I'm really new at this, so any advice would be appreciated.