I have a DataGridview with two adjacent combobox columns. The first one (called StockCategory) is bound to a bindingsource on the StockCategory table in SQL Server 2012. The next column is the Stock combobox, bound to a bindingsource on the Stock table. The requirement is simple: when the user selects a Stock Category from the first combobox, the only stock items available in the Stock combobox should be those in the selected Stock Category.
Setting a filter to the Stock table, based on the Stock category selection, works fine:
this.StockBindingSource.Filter = "MaterialGroup = " + this.radGridView1.CurrentRow.Cells["MatGroup"].Value;
Except that in this case all comboboxes in the Stock column are then filtered to the filter value, and previous Stock values in other rows seem to disappear.
I know it's an old problem and I've been looking at all sorts of random solutions on the web, but nothing seems to work.
Any help will be appreciated (I'm using RadGridView but the solution is probably generic?)