I have a child table (the "TestType" that is in my code below) that I am trying to bind to its parent ("Test" in the code. I've commented out that line below sice it doesn't fix my problem).
The Test table is bound to a BindingNavigator.
Everything displays ok. In other words, when I click the advance or back buttons of the navigator, the nameTextBox1 control shows the correct Test text, and the TestTypeControl (which is my user control) shows the test types. The problem is that TestType gets displayed not for the Test it should be bound to, but for the previous Test. In other words (again), If the test sequence when advancing is Test2, Test3, Test4, etc., the TestType is shown as TestType1, TestType2, TestType3, etc. So it looks like when I click the advance button of the navigator control, the TestType control is bound to the current bindingsource before Test is advanced. What I need is for Test to be advanced first, then TestType to be bound.
So how do I make the bindingNavigator perform its default action before the rest of the bindingNavigator1_ItemClicked function is performed.
Thanks.
Chuck Gantz
private void bindingNavigator1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
flowLayoutPanel1.Controls.Clear();
int cnt = testTypeBindingSource.List.Count;
//nameTextBox1.Text = ((BBTB.TestRow)((DataRowView)(testBindingSource.Cu rrencyManager.)).Row).name;
foreach (object row in testTypeBindingSource.List)
{
TestTypeControl ttCtl = new TestTypeControl();
ttCtl.Parent = flowLayoutPanel1;
ttCtl.TestTypeName = ((BBTB.TestTypeRow)((DataRowView)row).Row).name;
}
}