There are other alternatives, if you don't mind performing a round-trip to the server on each selection from the combo box. That is, rather than using the RowFilter to filter the grid, how about setting the SQL that fills the grid to include a parameter that pulls its value from the combo box? That is, add the following to your SQL (assuming you're loading data from SQL Server):
SELECT cnt_ProdCatDesc FROM YourTable WHERE cnt_BusinessID = @ID
Then, in the SelectedIndexChanged event of the combo box, you'll need to satisfy that @ID parameter, which you can do like this, if you've dragged a SqlDataAdapter onto the form from the toolbox:
SqlDataAdapter1.Parameters("@ID").Value = Me.cboEQ_EquipmentCategoryBusinessUnit.SelectedValue.ToString()
or something like that. If you haven't used the UI the create the SqlDataAdapter, you'll need to add the parameter to the Parameters collection yourself.
OTOH, your technique should work fine. I have an example I use for teaching where I have a DataView with both a sort and a RowFilter set, and it works fine--it must be some other issue causing the trouble. If you get the urge, send me a small sample that doesn't work (ken_getzAThotmailDOTcom) and I'll play with it. -- Ken |