Arg81
Well-known member
I'm trying to get a grid to show only the 1 row based on the value of a field in the main table.
I think I need to pick the value out of the dataTable itself, instead of from what's being displayed.
Anyway, the code I'm using is;
lblRecipeID is from my "main" table, "Development".
I've added that line of code to Form_Load, and each of the navigation buttons.
However, it doesn't work as expected, it's always 1 "step" out.
I.E.
I have a bindingNavigator for "development", the first 4 rows use recipeID 1 and the 5th row is recipeID 2.
If I browse through, the 5th row stays as 1, the 6th row then becomes 2. Even if I navigate back, I get the next row's value, not the one going back.
Unfortunately I can't use relationship, as the relation is 1 recipe ("child table") to many developments ("main table"), not the other way round - so I can't just drop the relation on the grid!
Any advice appriciated.
I think I need to pick the value out of the dataTable itself, instead of from what's being displayed.
Anyway, the code I'm using is;
VB.NET:
me.recipeBindingSource.Filter = string.format("RecipeID = '{0}'", me.lblRecipeID.text)
lblRecipeID is from my "main" table, "Development".
I've added that line of code to Form_Load, and each of the navigation buttons.
However, it doesn't work as expected, it's always 1 "step" out.
I.E.
I have a bindingNavigator for "development", the first 4 rows use recipeID 1 and the 5th row is recipeID 2.
If I browse through, the 5th row stays as 1, the 6th row then becomes 2. Even if I navigate back, I get the next row's value, not the one going back.
Unfortunately I can't use relationship, as the relation is 1 recipe ("child table") to many developments ("main table"), not the other way round - so I can't just drop the relation on the grid!
Any advice appriciated.